yaml.semgrep.metadata-subcategory-incorrect-value.metadata-subcategory-incorrect-value

Author
unknown
Download Count*
License
Semgrep rule likelihood: $VALUE detected, but the value must be vuln, audit, or guardrail. For more information visit: https://semgrep.dev/docs/contributing/contributing-to-semgrep-rules-repository/
Run Locally
Run in CI
Defintion
rules:
- id: metadata-subcategory-incorrect-value
patterns:
- pattern-inside: |
rules:
...
- pattern-inside: |
metadata:
...
category: security
...
- pattern: |
subcategory:
- $VALUE
- pattern-not: |
subcategory:
- vuln
- pattern-not: |
subcategory:
- audit
- pattern-not: |
subcategory:
- guardrail
message: "Semgrep rule likelihood: $VALUE detected, but the value must be vuln,
audit, or guardrail. For more information visit:
https://semgrep.dev/docs/contributing/contributing-to-semgrep-rules-repos\
itory/"
languages:
- yaml
severity: WARNING
metadata:
references:
- https://semgrep.dev/docs/contributing/contributing-to-semgrep-rules-repository/
category: correctness
technology:
- semgrep
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
Examples
metadata-subcategory-incorrect-value.test.yaml
rules:
- id: require-request
message: >-
If an attacker controls the x in require(x) then they can cause code to load that was not intended to run on the server.
severity: LOW
languages: [javascript, typescript]
# ok: metadata-subcategory-incorrect-value
metadata:
owasp: "A03:2021 - Injection"
cwe: "CWE-706: Use of Incorrectly-Resolved Name or Reference"
source-rule-url: https://nodesecroadmap.fyi/chapter-1/threat-UIR.html
category: security
likelihood: LOW
impact: LOW
confidence: LOW
subcategory:
- audit
technology:
- express
references:
- https://github.com/google/node-sec-roadmap/blob/master/chapter-2/dynamism.md#dynamism-when-you-need-it
patterns:
- id: require-request
message: >-
If an attacker controls the x in require(x) then they can cause code to load that was not intended to run on the server.
severity: LOW
languages: [javascript, typescript]
metadata:
owasp: "A03:2021 - Injection"
cwe: "CWE-706: Use of Incorrectly-Resolved Name or Reference"
source-rule-url: https://nodesecroadmap.fyi/chapter-1/threat-UIR.html
category: security
# ruleid: metadata-subcategory-incorrect-value
subcategory:
- potato
technology:
- express
references:
- https://github.com/google/node-sec-roadmap/blob/master/chapter-2/dynamism.md#dynamism-when-you-need-it
patterns:
Short Link: https://sg.run/qzly