Repository navigation
fix: honour Sanitizer models declared on project functions - #103
Merged
Merged
Conversation
The taint engine consulted sanitizer models only for external symbols without an interprocedural summary, so a Sanitizer on a function of the analysed project was inert and a code base could not declare its own validation layer. The declared model now takes precedence over the summary derived from the body, for same-file and cross-file calls alike; the flows and side effects the summary reports inside the callee are kept. Closes #95
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #95.
What
The taint engine consulted
Sanitizermodels only in theExternalSymbolbranch without an interprocedural summary. ASanitizerdeclared on a function of the analysed project was therefore inert: a code base could not declare its own validation layer.declared_clean(symbol, result): afterknown()computes the result of a project-function call, aSanitizerdeclared on that function strips its kinds from the result. The flows and side effects the summary reports inside the callee are kept — only the returned taint changes.ExternalSymbolwith a project summary (other file) andKnownFunction(same file). The same-file symbol isproject_symbol(module, name), so_TaintProblem/propagate_taintgain amoduleparameter thatTaintAnalysis.computefills fromctx.module.name.Tests
test_a_sanitizer_declared_on_a_project_function_overrides_its_summary— same file; asserts the flow exists without the model.test_a_sanitizer_declared_on_a_function_of_another_file_refutes_the_flow— cross-file, through a real plugin directory loaded next to the bundled ones; asserts the finding exists without it.Full suite: 891 passed.
ruff checkandmypy srcclean.Docs
Usage guide gains "Your own validation layer" showing
SanitizerandValidatoron project symbols (theValidatorcase was verified to refute a guarded flow); changelog entry under Unreleased.