High severityJavaInjectionMEDIUM confidence
LDAP Injection
An LDAP search filter is built by concatenating a runtime value into the filter string (CWE-90).
Standards mapping
- OWASP Top 10
- A03:2021 - Injection
- OWASP ASVS
- V5.3.7 (L1)
Vulnerable vs. safe
Flagged by this check
ctx.search(base, "(uid=" + username + ")", controls);Passes - the safe pattern
ctx.search(base, "(uid={0})", new Object[]{username}, controls);Why it matters & how to fix it
An LDAP search filter is built by concatenating a runtime value into the filter string (CWE-90). Attacker-controlled input can alter the filter logic. Escape the value with an LDAP filter encoder (e.g. Encode.forLdapFilter / a manual RFC 4515 escape) or use parameterized search filter arguments (search(base, filterExpr, filterArgs, ctls)).
References
Rule ID integsec-java-ldap-injection - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - InjectionCode Injection Tainted Input
- JavaScript / TypeScript - InjectionEval Dynamic Argument
- JavaScript / TypeScript - InjectionNoSQL Query From Request
- JavaScript / TypeScript - InjectionNoSQL Where Operator
- JavaScript / TypeScript - InjectionOS Command Injection Tainted Input
- JavaScript / TypeScript - InjectionSQL Injection String Concatenation