UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

42 lines (41 loc) 1.38 kB
rules: - id: unsafe-template-type message: >- Semgrep could not determine that the argument to 'template.HTML()' is a constant. 'template.HTML()' and similar does not escape contents. Be absolutely sure there is no user-controlled data in this template. If user data can reach this template, you may have a XSS vulnerability. Instead, do not use this function and use 'template.Execute()'. 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://golang.org/pkg/html/template/#HTML - https://github.com/0c34/govwa/blob/139693e56406b5684d2a6ae22c0af90717e149b8/vulnerability/xss/xss.go#L33 category: security technology: - go confidence: LOW cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM languages: [go] severity: WARNING patterns: - pattern-not: template.$ANY("..." + "...") - pattern-not: template.$ANY("...") - pattern-either: - pattern: template.HTML(...) - pattern: template.CSS(...) - pattern: template.HTMLAttr(...) - pattern: template.JS(...) - pattern: template.JSStr(...) - pattern: template.Srcset(...) - pattern: template.URL(...)