yaml.semgrep.metadata-impact-incorrect-value.metadata-impact-incorrect-value

Author
unknown
Download Count*
License
Semgrep rule impact: $VALUE detected, but the value must be LOW, MEDIUM, or HIGH. For more information visit: https://semgrep.dev/docs/contributing/contributing-to-semgrep-rules-repository/
Run Locally
Run in CI
Defintion
rules:
- id: metadata-impact-incorrect-value
patterns:
- pattern-inside: |
rules:
...
- pattern-inside: |
metadata:
...
category: security
...
- pattern: |
impact: $VALUE
- pattern-not: |
impact: LOW
- pattern-not: |
impact: MEDIUM
- pattern-not: |
impact: HIGH
message: "Semgrep rule impact: $VALUE detected, but the value must be LOW,
MEDIUM, or HIGH. For more information
visit: https://semgrep.dev/docs/contributing/contributing-to-semgrep-rul\
es-repository/"
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-impact-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]
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
# ruleid: metadata-impact-incorrect-value
impact: lOW
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
# ok: metadata-impact-incorrect-value
impact: LOW
likelihood: LOW
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/DqXo