UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

54 lines (53 loc) 1.3 kB
rules: - id: unescaped-data-in-js message: >- Found a formatted template string passed to 'template.JS()'. 'template.JS()' does not escape contents. Be absolutely sure there is no user-controlled data in this template. 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/#JS category: security technology: - go confidence: LOW cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM languages: [go] severity: WARNING pattern-either: - pattern: template.JS($T + $X, ...) - pattern: template.JS(fmt.$P("...", ...), ...) - pattern: | $T = "..." ... $T = $FXN(..., $T, ...) ... template.JS($T, ...) - pattern: | $T = fmt.$P("...", ...) ... template.JS($T, ...) - pattern: | $T, $ERR = fmt.$P("...", ...) ... template.JS($T, ...) - pattern: | $T = $X + $Y ... template.JS($T, ...) - pattern: | $T = "..." ... $OTHER, $ERR = fmt.$P(..., $T, ...) ... template.JS($OTHER, ...)