Skip to content

Commit 4c1c128

Browse files
hyperpolymathclaude
andcommitted
fix(assail): close CryptoMisuse self-reference FP (use code_only not content)
Self-scan of panic-attack found 1 Critical CryptoMisuse finding in src/assail/analyzer.rs itself — the detector's own source code. Cause: the dangerous_insecure_decode detector was using raw `content` instead of `code_only` (the string-, comment-, and test-mod-stripped variant that every other check in analyze_rust uses). The old code carried a comment claiming "this identifier never appears inside a string literal" — but that was immediately falsified by the format! macro right below, and by the #[test] fixture at line 5802. Fix: one-line change to use `code_only`. Comment updated to reflect the real reason (strip self-references, test fixtures, doc mentions). Dogfood pass: self-scan Critical count 15 -> 14 (remaining 14 are UnboundedAllocation from unbounded read_to_string calls in panic- attack's own src/ — triage pending, all are TPs by detector semantics and need .take(LIMIT) bounds the same way 007-lang got them). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 24b91b4 commit 4c1c128

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/assail/analyzer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,9 +1034,9 @@ impl Analyzer {
10341034
// This Rust function explicitly skips ALL JWT verification (signature,
10351035
// expiry, audience, issuer). Its name documents the risk; any call
10361036
// site is a CryptoMisuse finding regardless of context.
1037-
// Uses `content` directly — this identifier never appears inside a
1038-
// string literal, so string-stripping would only produce false negatives.
1039-
if content.contains("dangerous_insecure_decode") {
1037+
// Use `code_only` so the detector doesn't flag string literals that
1038+
// mention the identifier (analyzer self-reference, test fixtures, etc).
1039+
if code_only.contains("dangerous_insecure_decode") {
10401040
weak_points.push(WeakPoint {
10411041
file: None,
10421042
line: None,

0 commit comments

Comments
 (0)