fix(scanner): resolve DataFlowTracer stack overflow on cyclic dependencies and rule cache contamination - #66
Conversation
…ncies and rule cache contamination
…ems-after-test-module
|
@juangaitanv and @Ibrahimrahhal have a look |
…cycle assertion, and encapsulate scanner modules
|
Thanks @0xjgv for the great review! All three feedback items have been addressed in commit |
| let result1 = | ||
| tracer.analyze_sink_variable(path_str, "test_func", "var", "sink1", 3, &dedup1); | ||
| let result2 = | ||
| tracer.analyze_sink_variable(path_str, "test_func", "var", "sink2", 3, &dedup2); | ||
|
|
||
| assert!(matches!(result1, AnalysisResult::DefinitelyTainted { .. })); | ||
| assert!(!matches!(result2, AnalysisResult::DefinitelyTainted { .. })); |
There was a problem hiding this comment.
a leaked in-flight key makes the second call Unknown; could we assert its non-cyclic result, then rerun the first rule set and assert DefinitelyTainted?
…lve conflicts and update regression test assertions
|
Thanks @juangaitanv for the follow-up review!
|
…to handle non-tainted Unknown value source
|
Updated the test assertion in
|
| sink_line: usize, | ||
| rule_deduplicator: &TaintRuleDeduplicator, | ||
| ) -> VariableSource { | ||
| let rule_fingerprint = rule_deduplicator.fingerprint(); |
There was a problem hiding this comment.
production shares one deduplicator across rules, so the fingerprint does not isolate rule-specific cache entries. could we scope it to the active rule or derive a sink-specific identity and cover that path?
Summary
This PR resolves a critical, unlisted engine flaw in Sighthound's static dataflow and taint analysis engine (\DataFlowTracer):
Stack Overflow Panic on Cyclic Variable Dependencies:
Cross-Rule Cache Contamination & Vulnerability Escapes:
Verification