feat(sast): the CRA C rules also run on C++ (#373)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m42s

The C rules were semgrep `languages: [c]`, so C++ application code only
got cppcheck. They now run on C and C++, including the std:: spellings;
the control map says so, a test keeps the map and the rule pack in
step, and the nightly C fixture gains a C++ module with three planted
flaws.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-09-25 12:46:24 +02:00
1 parent e6e5b14a04
commit 2d7ab72136
7 files changed
+99 -13

No files matched your search

+8 -4
View File
@@ -123,7 +123,8 @@
"php",
"csharp",
"kotlin",
"c"
"c",
"cpp"
],
"cwe": [
"CWE-798",
@@ -263,7 +264,8 @@
"php",
"csharp",
"kotlin",
"c"
"c",
"cpp"
],
"cwe": [
"CWE-327",
@@ -351,7 +353,8 @@
"php",
"csharp",
"kotlin",
"c"
"c",
"cpp"
],
"cwe": [
"CWE-798",
@@ -403,7 +406,8 @@
"php",
"csharp",
"kotlin",
"c"
"c",
"cpp"
],
"cwe": [
"CWE-89",
+2 -1
View File
@@ -223,8 +223,9 @@ mod tests {
// Only Python/JS rules check secure defaults.
assert!(!secure_defaults.checked_for(&c_only));
assert!(secure_defaults.checked_for(&python));
// Our C rules and cppcheck check memory safety in C.
// Our C rules and cppcheck check memory safety in C, and in C++.
assert!(memory_safety.checked_for(&c_only));
assert!(memory_safety.checked_for(&["cpp".to_string()]));
// gitleaks reads any file, so no language is needed.
assert!(secrets.checked_for(&[]));
}