fix(detector): self-scan hygiene — .csreview-ignore for csreview's own rule definitions#18
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andsrc/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 excludessrc/detector.jsandsrc/dumpGuide.jsfrom 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, withsuppressedByIgnore > 0.Tests: +1 (self-audit guard). 176/176 · lint clean · typecheck 0.
🤖 Generated with Claude Code