UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

55 lines (54 loc) 1.27 kB
rules: - id: unsafe-dynamic-method message: >- Using non-static data to retrieve and run functions from the object is dangerous. If the data is user-controlled, it may allow executing arbitrary code. metadata: owasp: - A03:2021 - Injection cwe: - "CWE-94: Improper Control of Generation of Code ('Code Injection')" category: security technology: - javascript cwe2022-top25: true subcategory: - audit likelihood: LOW impact: LOW confidence: LOW references: - https://owasp.org/Top10/A03_2021-Injection languages: - javascript - typescript severity: WARNING patterns: - pattern-either: - pattern: $OBJ[$X](...) - pattern: | $Y = $OBJ[$X] ... $Y(...) - metavariable-pattern: patterns: - pattern-not: | "..." - pattern-not: | ($X: float) metavariable: $X - pattern-not-inside: | for (...) {...} - pattern-not-inside: | $SMTH.forEach(...) - pattern-not-inside: | $SMTH.map(...) - pattern-not-inside: | $SMTH.reduce(...) - pattern-not-inside: | $SMTH.reduceRight(...) - pattern-not-inside: | if (<... $OBJ.hasOwnProperty(...) ...>) { ... } ...