UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

70 lines (69 loc) 1.89 kB
rules: - id: vertx-sqli message: >- Detected a formatted string in a SQL statement. This could lead to SQL injection if variables in the SQL statement are not properly sanitized. Use a prepared statements (java.sql.PreparedStatement) instead. You can obtain a PreparedStatement using 'connection.prepareStatement'. languages: [java] severity: WARNING patterns: - pattern-either: - patterns: - pattern-either: - pattern-inside: | String $SQL = $X + $Y; ... - pattern-inside: | String $SQL = String.format(...); ... - pattern-inside: | $TYPE $FUNC(...,String $SQL,...) { ... } - pattern-not-inside: | String $SQL = "..." + "..."; ... - pattern: $SC.$METHOD($SQL,...) - pattern: | $SC.$METHOD(String.format(...),...); - pattern: | $SC.$METHOD($X + $Y,...); - pattern-either: - pattern-inside: | SqlClient $SC = ...; ... - pattern-inside: | SqlConnection $SC = ...; ... - pattern-inside: | $TYPE $FUNC(...,SqlClient $SC,...) { ... } - pattern-inside: | $TYPE $FUNC(...,SqlConnection $SC,...) { ... } - pattern-not: | $SC.$METHOD("..." + "...",...); - metavariable-regex: metavariable: $METHOD regex: ^(query|preparedQuery|prepare)$ metadata: cwe: - "CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')" category: security technology: - vertx owasp: - A01:2017 - Injection - A03:2021 - Injection references: - https://owasp.org/Top10/A03_2021-Injection cwe2022-top25: true cwe2021-top25: true subcategory: - audit likelihood: LOW impact: HIGH confidence: LOW