diff --git a/docs/codacy-rules.yaml b/docs/codacy-rules.yaml index 77fa0e4..9c67766 100644 --- a/docs/codacy-rules.yaml +++ b/docs/codacy-rules.yaml @@ -625,28 +625,4 @@ rules: impact: HIGH confidence: HIGH references: - - https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/ - - id: codacy.c.security.avoid-std-system - languages: - - cpp - - c - severity: WARNING - message: > - Detected a call to the standard `system()` function. This is dangerous - as it can lead to Command Injection if untrusted input is passed. - Ensure you are using safe alternatives or properly validating/sanitizing any input used in system calls. - patterns: - # Catch standard system calls, whether global or explicitly in std:: - - pattern-either: - - pattern: system(...) - - pattern: std::system(...) - - pattern: ::system(...) - # Explicitly ignore calls to your custom namespace - - pattern-not: osutility::system(...) - metadata: - category: security - description: > - Detects calls to the standard `system()` function which can lead to Command Injection vulnerabilities. - Ensure safe alternatives or proper input validation/sanitization is used. - impact: MEDIUM - confidence: LOW \ No newline at end of file + - https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/ \ No newline at end of file diff --git a/docs/multiple-tests/codacy-rules/patterns.xml b/docs/multiple-tests/codacy-rules/patterns.xml index d1b0894..61bca42 100644 --- a/docs/multiple-tests/codacy-rules/patterns.xml +++ b/docs/multiple-tests/codacy-rules/patterns.xml @@ -16,5 +16,4 @@ - diff --git a/docs/multiple-tests/codacy-rules/results.xml b/docs/multiple-tests/codacy-rules/results.xml index 93dc22e..924a099 100644 --- a/docs/multiple-tests/codacy-rules/results.xml +++ b/docs/multiple-tests/codacy-rules/results.xml @@ -56,9 +56,4 @@ - - - - - diff --git a/docs/multiple-tests/codacy-rules/src/codacy-c-avoid-std-system.cpp b/docs/multiple-tests/codacy-rules/src/codacy-c-avoid-std-system.cpp deleted file mode 100644 index 39601bc..0000000 --- a/docs/multiple-tests/codacy-rules/src/codacy-c-avoid-std-system.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include -#include - -namespace newNamespace { - using String_t = std::string; -} - -namespace osutility { - // [SHOULD NOT FLAG]: This is a definition. - std::int32_t system(const newNamespace::String_t& cmd, newNamespace::String_t& output) { - output = "Executed safely: " + cmd; - return 0; // Success - } -} - -int main() { - newNamespace::String_t my_cmd = "ls -la"; - newNamespace::String_t my_out; - - // [SHOULD NOT FLAG]: Custom system function in osutility namespace - osutility::system(my_cmd, my_out); - - // [SHOULD FLAG]: Standard global system call - system("echo 'This is dangerous'"); - - // [SHOULD FLAG]: Explicit standard namespace system call - std::system("echo 'This is also dangerous'"); - - // [SHOULD FLAG]: Explicit global namespace system call - ::system("echo 'Still dangerous'"); - - return 0; -} \ No newline at end of file