Repository navigation
feat: security models and global taint engine - #20
Merged
Merged
Conversation
4 tasks done
6 tasks done
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.
Summary
Opens Phase 5 of
docs/architecture.mdwith §16 Security Model Registry and §17 Global Taint Engine.test: define security models and taint engine behavior), implementation follows.taint/models.py:TaintKindbitset (SQL, COMMAND, HTML, PATH, SSRF, CODE, joined with|),Source,SinkandSanitizermodels keyed by canonical symbol, a mutableSecurityModelRegistrythat plugins fill and freeze into an immutableModelTable, exposed to the manager as thetaint.modelsinput.AnalysisManager.provide: a generic way to supply the result of a module-level analysis the engine computes elsewhere, withMissingInputErrorwhen such an input is requested before being provided. This keeps the manager free of any security-specific knowledge.taint/engine.py: one sharedTaintAnalysis(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 aTaintFlowwith 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