UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

49 lines (48 loc) 1.24 kB
rules: - id: dangerous-command-write patterns: - pattern: | $CW.Write($BYTE) - pattern-inside: | $CW,$ERR := $CMD.StdinPipe() ... - pattern-not: | $CW.Write("...") - pattern-not: | $CW.Write([]byte("...")) - pattern-not: | $CW.Write([]byte("..."+"...")) - pattern-not-inside: | $BYTE = []byte("..."); ... - pattern-not-inside: | $BYTE = []byte("..."+"..."); ... - pattern-inside: | import "os/exec" ... message: >- Detected non-static command inside Write. Audit the input to '$CW.Write'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code. severity: ERROR languages: [go] metadata: cwe: - "CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')" category: security technology: - go confidence: LOW owasp: - A01:2017 - Injection - A03:2021 - Injection references: - https://owasp.org/Top10/A03_2021-Injection cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: HIGH