Skip to content

Commit 9a938f3

Browse files
rng1995claude
andcommitted
fix(taint): drop forwarded-kwargs fan-out and keep source and message semantics
Address the fourth review round. - A forwarded **kwargs (a function's own ** parameter passed on) binds only into the callee's own ** parameter: one slot per callee, and it never fills named, keyword-only or receiver parameters. This removes the per-name expansion (up to 85 targets per **k) and the false positives from one tainted keyword reaching every forwarded one. - A source call's value is what it reads, not its arguments, so json.load(open(os.getenv(...))) is TT4 again, as on main. - Sinks cite variables main's flows taint (phase A) before parameters only the new flows bind, so same-rule messages keep main's wording. - A class-body read of a name the class binds reads a view fed by the module and class keys; the class attribute keeps only the class's own value. Any class-body binding (annotated assignment, import, def) shadows a base's value; an annotation alone binds nothing. - An immediately called lambda in a default yields its body's value. - C3 merges every base and caps only the result. - Deadline checks per argument and keyword in bind_arguments and every 1,024 flows of one key in drain. - CHANGELOG: exact fingerprints are version-bound; list every message change category and raised rule. Tests pin each case, add non-root nested-default and many-base scaling shapes, the forwarded-kwargs cost, the slot-cap boundary for *rest, the multi-base ancestor cap, C3 local precedence, and non-constructor self()/cls() calls. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 78b571c commit 9a938f3

3 files changed

Lines changed: 509 additions & 155 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### 2.12.0 (Unreleased)
22
### Features/Bug Fixes
3-
* fix(taint): key TT1-TT6 taint by lexical scope and follow direct calls to functions and methods defined in the same file, so a tainted variable no longer taints same-named variables in other functions (#799). Exact baseline fingerprints and message-glob rules from earlier versions keep matching TT findings whose rule and message are unchanged. They stop matching where the earlier message came from a same-named variable in another scope (the message now names the variable, source and line that reach the sink), where a more severe source now applies at the sink (TT2/TT4 to TT3, TT2 to TT5/TT6), and where an identifier longer than 120 characters is now shortened; re-accept those findings or regenerate the baseline. `match_fingerprint` changes only when the rule does.
3+
* fix(taint): key TT1-TT6 taint by lexical scope and follow direct calls to functions and methods defined in the same file, so a tainted variable no longer taints same-named variables in other functions (#799). Message-glob baseline rules keep matching TT findings whose rule and message are unchanged; exact baseline fingerprints are bound to the scanner version and suppress nothing after an upgrade (see docs/SUPPRESSION.md), so they must be regenerated in any case. A TT message changes where the earlier message came from a same-named variable in another scope (it now names the variable, source and line that reach the sink); where a more severe source raises the rule (TT2 to TT3 or TT4, TT4 to TT3, TT2 to TT5 or TT6), and at such a sink, where a weaker finding is subsumed or now cites another variable; and where an identifier longer than 120 characters is now shortened. Re-accept those findings or regenerate the baseline. `match_fingerprint` changes only when the rule does.
44
* fix(static): stop code comparisons after removal verbs from reading as unterminated tag-marker directives (#777)
55
* fix(baseline): fingerprint every occurrence of a deduplicated finding so the next scan suppresses all of them (#633)
66
* fix(security): retain incomplete coverage for runtime-selected commands and remeasure active Git clones strictly (#514)

0 commit comments

Comments
 (0)