UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

44 lines (43 loc) 1.37 kB
rules: - id: ldap-injection message: LDAP queries are constructed dynamically on user-controlled input. This vulnerability in code could lead to an arbitrary LDAP query execution. severity: ERROR metadata: likelihood: MEDIUM impact: MEDIUM confidence: MEDIUM category: security cwe: - "CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')" owasp: - A01:2017 - Injection - A03:2021 - Injection references: - https://owasp.org/Top10/A03_2021-Injection/ - https://cwe.mitre.org/data/definitions/90 - https://cheatsheetseries.owasp.org/cheatsheets/LDAP_Injection_Prevention_Cheat_Sheet.html#safe-c-sharp-net-tba-example subcategory: - vuln technology: - .net languages: - csharp mode: taint options: taint_unify_mvars: true pattern-sources: - patterns: - focus-metavariable: $INPUT - pattern-inside: $T $M(...,$INPUT,...) {...} pattern-sinks: - patterns: - pattern-either: - pattern: $S.Filter = ... + $INPUT + ... - pattern: $S.Filter = String.Format(...,$INPUT) - pattern: $S.Filter = String.Concat(...,$INPUT) pattern-sanitizers: - pattern-either: - pattern: Regex.Replace($INPUT, ...) - pattern: $ENCODER.LdapFilterEncode($INPUT) - pattern: $ENCODER.LdapDistinguishedNameEncode($INPUT)