Skip to content

fix(detector): self-scan hygiene — .csreview-ignore for csreview's own rule definitions#18

Merged
decksoftware merged 1 commit into
mainfrom
fix/self-scan-ignore-ruledefs
Jun 3, 2026
Merged

fix(detector): self-scan hygiene — .csreview-ignore for csreview's own rule definitions#18
decksoftware merged 1 commit into
mainfrom
fix/self-scan-ignore-ruledefs

Conversation

@decksoftware

Copy link
Copy Markdown
Owner

Self-scan hygiene: don't flag csreview's own rulebook

Follow-up to #17. Thanks again @thiago — after the WEAK_CIPHER fix the only residual false positives were csreview matching its own rule definitions when auditing itself: src/detector.js (regex literals, rule names, descriptions, exploitation examples → 9 hits) and src/dumpGuide.js (the DB-dump guide's sample connection string → 1 hit). A scanner flagging its own rulebook — noise that exists only when scanning csreview itself, never in a user's project.

Fix

Ship a .csreview-ignore (at the repo root and the package dir, **/-prefixed so it works from either scan root) that excludes src/detector.js and src/dumpGuide.js from the report. This is the existing read-only, report-level suppression mechanism — no engine change. Logic bugs in those files are still covered by Semgrep + CodeQL in CI.

Verification

New test runs a real self-audit (runAnalysis, runTools: false) against the package and asserts zero findings in the rule-definition files, with suppressedByIgnore > 0.

Tests: +1 (self-audit guard). 176/176 · lint clean · typecheck 0.

🤖 Generated with Claude Code

… own rulebook

Follow-up to the detector calibration (#17). User feedback (Thiago via GPT): the
remaining false positives were in src/detector.js itself — the heuristic detector
matching its OWN rule definitions (regex literals, rule names, descriptions,
exploitation examples) plus dumpGuide.js's sample connection strings. This only
happens when csreview audits its own source; it never occurs in user projects.

- Ship .csreview-ignore (repo root + package dir) excluding src/detector.js and
  src/dumpGuide.js from the report — report-level, read-only suppression via the
  existing ignore mechanism. `**/`-prefixed so it works from either scan root.
- Logic bugs in those files remain covered by Semgrep + CodeQL in CI.
- Test: a self-audit (runAnalysis, runTools:false) now yields zero findings in the
  rule-definition files and records them under suppressedByIgnore.

176/176 - lint clean - typecheck 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@decksoftware decksoftware merged commit 76055dd into main Jun 3, 2026
12 checks passed
@decksoftware decksoftware deleted the fix/self-scan-ignore-ruledefs branch June 3, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant