UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

41 lines (40 loc) 1.19 kB
rules: - id: unquoted-attribute 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: "<%= expr %>".' 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://brakemanpro.com/2017/09/08/cross-site-scripting-in-rails#unquoted-attributes - https://flask.palletsprojects.com/en/1.1.x/security/#cross-site-scripting-xss category: security technology: - rails cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM confidence: LOW languages: - generic paths: include: - '*.erb' severity: WARNING patterns: - pattern-inside: <$TAG ...> - pattern-not-inside: ="..." - pattern-not-inside: ="<%= ... %>" - pattern-not-inside: ='...' - pattern-not-inside: ='<%= ... %>' - pattern: <%= ... %> fix-regex: regex: <%=(.*?)%> replacement: '"<%=\1%>"'