UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

101 lines (100 loc) 2.29 kB
rules: - id: spel-injection message: >- A Spring expression is built with a dynamic value. The source of the value(s) should be verified to avoid that unfiltered values fall into this risky code evaluation. metadata: cwe: - "CWE-94: Improper Control of Generation of Code ('Code Injection')" owasp: - A03:2021 - Injection source-rule-url: https://find-sec-bugs.github.io/bugs.htm#SPEL_INJECTION category: security technology: - spring references: - https://owasp.org/Top10/A03_2021-Injection cwe2022-top25: true subcategory: - audit likelihood: LOW impact: HIGH confidence: LOW severity: WARNING languages: [java] patterns: - pattern-either: - pattern-inside: | class $CLASS { ... ExpressionParser $PARSER; ... } - pattern-inside: | class $CLASS { ... ExpressionParser $PARSER = ...; ... } - pattern-inside: | $X $METHOD(...) { ... ExpressionParser $PARSER = ...; ... } - pattern-inside: | class $CLASS { ... SpelExpressionParser $PARSER; ... } - pattern-inside: | class $CLASS { ... SpelExpressionParser $PARSER = ...; ... } - pattern-inside: | $X $METHOD(...) { ... SpelExpressionParser $PARSER = ...; ... } - pattern-inside: | class $CLASS { ... TemplateAwareExpressionParser $PARSER; ... } - pattern-inside: | class $CLASS { ... TemplateAwareExpressionParser $PARSER = ...; ... } - pattern-inside: | $X $METHOD(...) { ... TemplateAwareExpressionParser $PARSER = ...; ... } - pattern: | $X $METHOD(...) { ... $PARSER.parseExpression(...); ... } - pattern-not: | $X $METHOD(...) { ... $PARSER.parseExpression("..."); ... } - pattern-not: | $X $METHOD(...) { ... String $S = "..."; ... $PARSER.parseExpression($S); ... }