Skip to content

fix: honour Sanitizer models declared on project functions - #103

Merged
SizzleUnrlsd merged 3 commits into
mainfrom
fix/project-sanitizers
Sep 21, 2026
Merged

SizzleUnrlsd merged 3 commits into
mainfrom
fix/project-sanitizers

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Closes #95.

What

The taint engine consulted Sanitizer models only in the ExternalSymbol branch without an interprocedural summary. A Sanitizer declared on a function of the analysed project was therefore inert: a code base could not declare its own validation layer.

  • declared_clean(symbol, result): after known() computes the result of a project-function call, a Sanitizer declared 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.
  • Applied on both branches: ExternalSymbol with a project summary (other file) and KnownFunction (same file). The same-file symbol is project_symbol(module, name), so _TaintProblem/propagate_taint gain a module parameter that TaintAnalysis.compute fills from ctx.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 check and mypy src clean.

Docs

Usage guide gains "Your own validation layer" showing Sanitizer and Validator on project symbols (the Validator case was verified to refute a guarded flow); changelog entry under Unreleased.

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
@SizzleUnrlsd
SizzleUnrlsd merged commit f0e2645 into main Sep 21, 2026
10 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the fix/project-sanitizers branch September 21, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Precision: honour Sanitizer models declared on project functions

1 participant