UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

45 lines (44 loc) 1.22 kB
rules: - id: check-send-file mode: taint pattern-sources: - pattern-either: - pattern: | cookies[...] - patterns: - pattern: | cookies. ... .$PROPERTY[...] - metavariable-regex: metavariable: $PROPERTY regex: (?!signed|encrypted) - pattern: | params[...] - pattern: | request.env[...] pattern-sinks: - patterns: - pattern: | send_file ... message: Allowing user input to `send_file` allows a malicious user to potentially read arbitrary files from the server. Avoid accepting user input in `send_file` or normalize with `File.basename(...)` languages: - ruby severity: ERROR metadata: source-rule-url: https://github.com/presidentbeef/brakeman/blob/main/lib/brakeman/checks/check_send_file.rb category: security cwe: - 'CWE-73: External Control of File Name or Path' owasp: - A04:2021 - Insecure Design technology: - ruby - rails references: - https://owasp.org/www-community/attacks/Path_Traversal - https://owasp.org/Top10/A01_2021-Broken_Access_Control/ subcategory: - vuln likelihood: MEDIUM impact: MEDIUM confidence: MEDIUM