UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

45 lines 1.23 kB
rules: - id: bad-send message: >- Checks for unsafe use of Object#send, try, __send__, and public_send. These only account for unsafe use of a method, not target. This can lead to arbitrary calling of exit, along with arbitrary code execution. Please be sure to sanitize input in order to avoid this. metadata: cwe: - "CWE-94: Improper Control of Generation of Code ('Code Injection')" references: - https://github.com/presidentbeef/brakeman/blob/main/lib/brakeman/checks/check_send.rb - https://the.igreque.info/posts/2016/01-object-send-considered-harmful-en.html category: security technology: - ruby owasp: - A03:2021 - Injection cwe2022-top25: true subcategory: - audit likelihood: LOW impact: MEDIUM confidence: LOW languages: - ruby severity: ERROR pattern-either: - pattern: | $PARAM = params[...] ... $RES = $MOD.send($PARAM.$FUNC) - pattern: | $PARAM = params[...] ... $RES = $MOD.try($PARAM.$FUNC) - pattern: | $PARAM = params[...] ... $RES = $MOD.__send__($PARAM.$FUNC) - pattern: | $PARAM = params[...] ... $RES = $MOD.public_send($PARAM.$FUNC)