UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

29 lines (28 loc) 842 B
rules: - id: mb-ereg-replace-eval patterns: - pattern: mb_ereg_replace($PATTERN, $REPL, $STR, $OPTIONS); - pattern-not: mb_ereg_replace($PATTERN, $REPL, $STR, "..."); message: >- Calling mb_ereg_replace with user input in the options can lead to arbitrary code execution. The eval modifier (`e`) evaluates the replacement argument as code. metadata: cwe: - "CWE-94: Improper Control of Generation of Code ('Code Injection')" references: - https://www.php.net/manual/en/function.mb-ereg-replace.php - https://www.php.net/manual/en/function.mb-regex-set-options.php category: security technology: - php owasp: - A03:2021 - Injection cwe2022-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM confidence: LOW languages: [php] severity: ERROR