You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
taint tracking: keep a set of sources per name so reassignment can't drop the stronger TT rule #750
Follow-up from the review of #611 (fixes #610). The behavioral_taint_tracking analyzer keys taint by variable name, storing a single source per name. When a name is reassigned from different sources, only one source survives, so a sink can be attributed to the wrong source rule and a stronger TT finding can be lost.
Detail
_collect_tainted records one source_call per name (_mark_targets is add-only and keeps the first writer; main's single-pass kept the last writer). Either way, for:
secret = os.environ["API_KEY"] # would drive the stronger rule (e.g. TT3/TT5)
secret = request.args.get("x") # weaker/other classification
sink(secret)
the surviving source depends on write order (first-write under #611, last-write on main), and the other is dropped. An author could also order the writes to pick which rule fires. In both models the sink is still reported, but potentially under a weaker TT rule than one of its real sources warrants.
Proposed direction
Track a set of sources per name rather than a single source_call, and when a sink consumes a name, emit/classify against the strongest applicable source (or all of them). This keeps the order-independent, add-only, fire-once worklist from #611 — the value would become a set that only grows.
Scope: src/skillspector/nodes/analyzers/behavioral_taint_tracking.py (_collect_tainted, _mark_targets, _TaintedVar, and the sink-emission classification).
Resolved by merged PR #799 (merge commit 530d3c5c), verified on main 95a52d89 on 2026-10-19.
The analyzer now retains bounded, ranked source information for each sink category, so reassignment cannot discard the stronger applicable TT classification merely by changing source order. This achieves the issue's requested strongest-source outcome without requiring an unbounded set of source facts.
Regression coverage verifies both assignment orders, alias propagation, late source upgrades, helper flows, and sink-specific ranking. The behavioral-taint suite passed as part of a fresh 349-test offline run; no specimen code or live provider requests were executed.
Closing as completed. PR #754 was closed without merging; the accepted implementation landed independently in #799.
Activity
rng1995 commentedon Oct 19, 2026
Resolved by merged PR #799 (merge commit
530d3c5c), verified on main95a52d89on 2026-10-19.The analyzer now retains bounded, ranked source information for each sink category, so reassignment cannot discard the stronger applicable TT classification merely by changing source order. This achieves the issue's requested strongest-source outcome without requiring an unbounded set of source facts.
Regression coverage verifies both assignment orders, alias propagation, late source upgrades, helper flows, and sink-specific ranking. The behavioral-taint suite passed as part of a fresh 349-test offline run; no specimen code or live provider requests were executed.
Closing as completed. PR #754 was closed without merging; the accepted implementation landed independently in #799.