Created
July 8, 2021 22:55
-
-
Save minusworld/968d229f81b9048b80aaa783cd1fe228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
- id: user-input-escaped-with-safe | |
mode: join | |
join: | |
refs: | |
- rule: https://raw.githubusercontent.com/minusworld/semgrep-library/main/rules/flask/flask-user-input.yaml | |
as: user-input | |
- rule: https://raw.githubusercontent.com/minusworld/semgrep-library/main/rules/flask/render-template-input.yaml | |
as: render-template-input | |
- rule: https://raw.githubusercontent.com/minusworld/semgrep-library/main/rules/flask/template-var-safe.yaml | |
renames: | |
- from: '$...EXPR' | |
to: '$VAR' | |
as: template-vars | |
on: | |
- 'user-input.$VAR == render-template-input.$INPUT' | |
- 'render-template-input.$VAR == template-vars.$VAR' | |
- 'render-template-input.$TEMPLATE ~ template-vars.path' | |
message: >- | |
The variable '$VAR' is most likely an XSS. It originates as user input | |
and is unsafely rendered with the '| safe' filter. | |
severity: ERROR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment