UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

48 lines (47 loc) 1.17 kB
rules: - id: open-redirect mode: taint pattern-sources: - patterns: - focus-metavariable: $PARAM - pattern-inside: | public $TYPE $FUNCNAME (..., string $PARAM, ...) { ... } pattern-sinks: - patterns: - pattern: Redirect(...) - pattern-not-inside: | if (IsLocalUrl(...)) { ... Redirect(...); ... } - pattern-not-inside: | if ($URL.IsLocalUrl(...)) { ... Redirect(...); ... } message: >- A query string parameter may contain a URL value that could cause the web application to redirect the request to a malicious website controlled by an attacker. Make sure to sanitize this parameter sufficiently. metadata: category: security technology: - csharp cwe: - "CWE-601: URL Redirection to Untrusted Site ('Open Redirect')" references: - https://cwe.mitre.org/data/definitions/601.html owasp: - A01:2021 - Broken Access Control subcategory: - vuln likelihood: MEDIUM impact: MEDIUM confidence: LOW languages: - csharp severity: ERROR