UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

54 lines (53 loc) 1.49 kB
rules: - id: template-unquoted-attribute-var message: >- Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ $...VAR }}". metadata: cwe: - "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')" owasp: - A07:2017 - Cross-Site Scripting (XSS) - A03:2021 - Injection references: - https://flask.palletsprojects.com/en/1.1.x/security/#cross-site-scripting-xss category: security technology: - flask cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM confidence: LOW languages: - generic paths: include: - '*.html' - '*.py' severity: WARNING patterns: - pattern: ={{$...VAR}} - pattern-inside: | <$TAG ... > - metavariable-pattern: metavariable: $...VAR pattern-either: - pattern: | request.$VALUE.get(...) - pattern: | request.$VALUE['...'] - patterns: - pattern: $REQ - pattern-either: - pattern-inside: | $REQ = request.$VALUE.get(...) ... - pattern-inside: | $REQ = request.$VALUE['...'] ... fix: | ="{{$...VAR}}"