Skip to content

Commit 38b3b9f

Browse files
dev-ecd-dmclaude
andcommitted
fix(security): use bare nosemgrep for the glob-matcher RegExp (CI rule-id resolution)
The rule-id-scoped `// nosemgrep` added in #14 suppressed the detect-non-literal-regexp finding locally — verified with the exact CI toolchain (Semgrep 1.164.0, `semgrep scan --config auto --sarif`) producing an empty SARIF — but CI's auto-resolved rule id apparently differs, so code-scanning alert #47 reopened on the same line. A bare `// nosemgrep` does not depend on rule-id matching and is robust to that resolution. Verified: a full-repo scan with the identical CI command yields 0 results. 167/167 - lint clean - typecheck 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ef8e8e3 commit 38b3b9f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

csreview/src/ignore.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ export function patternToMatcher(rawPattern) {
103103
// user's own .csreview-ignore or built-in defaults (a local dev tool), and the
104104
// behaviour is unit-tested (ignore.test.js "ReDoS H1"). The dynamic RegExp is
105105
// intrinsic to a glob matcher, so this audit finding is suppressed inline.
106-
return { negate, re: new RegExp(prefix + body + suffix) }; // nosemgrep: javascript.lang.security.audit.detect-non-literal-regexp.detect-non-literal-regexp
106+
// Bare nosemgrep (not rule-id-scoped) so the suppression is robust to how the
107+
// CI's `--config auto` resolves the rule's internal id.
108+
return { negate, re: new RegExp(prefix + body + suffix) }; // nosemgrep
107109
}
108110

109111
/**

0 commit comments

Comments
 (0)