UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

43 lines (42 loc) 1.21 kB
rules: - id: direct-use-of-jinja2 message: >- Detected direct use of jinja2. If not done properly, this may bypass HTML escaping which opens up the application to cross-site scripting (XSS) vulnerabilities. Prefer using the Flask method 'render_template()' and templates with a '.html' extension in order to prevent XSS. 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://jinja.palletsprojects.com/en/2.11.x/api/#basics category: security technology: - flask cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM confidence: LOW languages: - python severity: WARNING pattern-either: - pattern: jinja2.Environment(...) - pattern: jinja2.Template.render(...) - patterns: - pattern-inside: | $TEMPLATE = $ENV.get_template(...) ... - pattern: $TEMPLATE.render(...) - patterns: - pattern-inside: | $TEMPLATE = jinja2.Template(...) ... - pattern: $TEMPLATE.render(...)