Skip to content

feat: security models and global taint engine - #20

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/taint
Sep 3, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/taint

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Opens Phase 5 of docs/architecture.md with §16 Security Model Registry and §17 Global Taint Engine.

  • Acceptance tests first (test: define security models and taint engine behavior), implementation follows.
  • taint/models.py: TaintKind bitset (SQL, COMMAND, HTML, PATH, SSRF, CODE, joined with |), Source, Sink and Sanitizer models keyed by canonical symbol, a mutable SecurityModelRegistry that plugins fill and freeze into an immutable ModelTable, exposed to the manager as the taint.models input.
  • AnalysisManager.provide: a generic way to supply the result of a module-level analysis the engine computes elsewhere, with MissingInputError when such an input is requested before being provided. This keeps the manager free of any security-specific knowledge.
  • taint/engine.py: one shared TaintAnalysis (taint.flows) per function, a forward data-flow problem over the SSA form. Source symbols and their call results carry taint; arithmetic, attribute and item access, iteration, phis and unknown calls propagate the union; sanitizers clear their kinds; comparisons and literals carry nothing. Every tainted argument reaching a sink whose kinds it still carries becomes a TaintFlow with its source, sink, kinds, argument and call location, in block then instruction order.

The engine is the second client of the data-flow solver after constant propagation, and the first consumer of provide.

Not in this PR: findings and reporters, and the detectors that turn flows into findings (next two Phase 5 items). Method sinks reached through attributes on objects (cursor.execute) wait on framework models and the call graph.

Closes #19

@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 3, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit 2f973d0 into main Sep 3, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/taint branch September 3, 2026 22:17
@SizzleUnrlsd SizzleUnrlsd mentioned this pull request Sep 3, 2026
6 tasks done
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.

Create security model registry and global taint engine

1 participant