WSTG-v42-INPV-06 / GUIDANCE
Testing for LDAP Injection
The Lightweight Directory Access Protocol (LDAP) is used to store information about users, hosts, and many other objects. LDAP injection is a server-side attack, which could allow sensitive information about users and hosts represented in an LDAP structure to be disclosed, modified, or inserted. This is done by manipulating input parameters afterwards passed to internal search, add, and modify functions. A web application could use LDAP in order to let users authenticate or search other users' information inside a corporate structure. The goal of LDAP injection attacks is to inject LDAP search filters metacharacters in a query which will be executed by the application. Rfc2254 defines a grammar on how to build a search filter on LDAPv3 and extends Rfc1960 (LDAPv2). An LDAP search filter is constructed in Polish notation, also known as Polish notation prefix notation. This means that a pseudo code condition on a search filter like this: find("cn=John & userPassword=mypass") will be represented as: find("(&(cn=John)(userPassword=mypass))") Boolean conditions and group aggregations on an LDAP search filter could be applied by using the following metacharacters: | Metachar | Meaning | |----------|-----------------------| | & | Boolean AND | | \| | Boolean OR | | ! | Boolean NOT | | = | Equals | | ~= | Approx | | >= | Greater than | | <= | Less than | | | Any character | | () | Grouping parenthesis | More complete examples on how to build a search filter can be found in the related RFC. A successful exploitation of an LDAP injection vulnerability could allow the tester to: - […]
- Category
- OWASP assurance
- Version / scope
- OWASP WSTG pinned commit dd33419
- Affected / relevant technologies
- Web applications
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
Apply only to authorized systems and select the relevant scope and verification level. This publisher reference is not evidence of a completed assessment.
Potential impact
The publisher describes a verification objective; applicability does not establish a local defect or a compliance result.
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: OWASP. Release: OWASP WSTG pinned commit dd33419. Source checked: 2026-11-18.
Source object: document/4-Web_Application_Security_Testing/07-Input_Validation_Testing/06-Testing_for_LDAP_Injection.md.
Attribution and source terms (OWASP contributors · CC BY-SA 4.0)Detection and investigation
- - Identify LDAP injection points. - Assess the severity of the injection.
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- Review the complete publisher reference and relevant platform documentation; the source excerpt is not a tested mitigation.
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
No protocol-specific mapping is asserted for this entry.
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- https://github.com/OWASP/wstg/blob/dd33419e10edb22b78d89325a6c2aad9f184e3a2/document/4-Web_Application_Security_Testing/07-Input_Validation_Testing/06-Testing_for_LDAP_Injection.md — Publisher link; not separately HTTP-checked
- document/4-Web_Application_Security_Testing/07-Input_Validation_Testing/06-Testing_for_LDAP_Injection.md — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
