UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

41 lines (40 loc) 1.12 kB
rules: - id: no-printf-in-responsewriter message: >- Detected 'printf' or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package to render data to users. metadata: owasp: - A07:2017 - Cross-Site Scripting (XSS) - A03:2021 - Injection cwe: - "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')" references: - https://blogtitle.github.io/robn-go-security-pearls-cross-site-scripting-xss/ category: security technology: - go confidence: LOW cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM severity: WARNING patterns: - pattern-either: - pattern-inside: | func $HANDLER(..., $WRITER http.ResponseWriter, ...) { ... } - pattern-inside: | func(..., $WRITER http.ResponseWriter, ...) { ... } - pattern: | $WRITER.Write(<... fmt.$PRINTF(...) ...>, ...) languages: - go