CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')
The product constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.
Last updated
Overview
CWE-90 (Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
66 recorded CVEs are caused by CWE-90 (Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')). The highest-severity and most recent are shown first. 39 new CWE-90 CVEs have been recorded so far in 2026 (10 in 2025).
- CVE-2026-44930
Apache CXF: LDAP Injection vulnerability in XKMS LDAP Repository
Critical · CVSS 9.8 · EPSS 50th2026-05-22 - CVE-2026-33289
SuiterCRM has LDAP Filter Injection in Authentication Module
Critical · CVSS 9.8 · EPSS 49th2026-03-19 - CVE-2024-54852Critical · CVSS 9.8 · EPSS 53th2025-01-29
- CVE-2024-33868Critical · CVSS 9.8 · EPSS 57th2024-05-14
- CVE-2023-6905
Jahastech NxFilter Bind Request ldap injection
Critical · CVSS 9.8 · EPSS 49th2023-12-17 - CVE-2015-10027Critical · CVSS 9.8 · EPSS 56th2023-01-07
- CVE-2021-43350Critical · CVSS 9.8 · EPSS 91th2021-11-11
- CVE-2023-29050Critical · CVSS 9.6 · EPSS 75th2024-01-08
- CVE-2026-41919
Apache OFBiz: Authentication Bypass due to Improper Neutralization of LDAP Special Elements in DN Construction
Critical · CVSS 9.1 · EPSS 38th2026-05-19 - CVE-2024-56841Critical · CVSS 9.1 · EPSS 41th2025-01-14
- CVE-2025-67493
Homarr issing input sanitization and possible privilege escalation through ldap search query injection
Critical · CVSS 9.0 · EPSS 23th2025-12-17 - CVE-2026-58222
Samba: samba ad ldap compare filter injection and trusted-request confusion disclose protected attributes
High · CVSS 8.8 · EPSS 38th2026-07-30
Showing 12 of 66 recorded CWE-90 CVEs. Track new ones as they are published and get AI-written analysis and fixes.
Monitor CWE-90 vulnerabilitiesCommon consequences
What can happen when CWE-90 is exploited.
Execute Unauthorized Code or Commands, Read Application Data, Modify Application Data
Affects: Confidentiality, Integrity, Availability
An attacker could include input that changes the LDAP query which allows unintended commands or code to be executed, allows sensitive data to be read or modified or causes other unintended behavior.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Technologies
How to prevent it
Practical mitigations for CWE-90, grouped by where in the lifecycle they apply.
Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Code examples
Illustrative examples from MITRE showing how the weakness appears in code.
The code below constructs an LDAP query using user input address data:
Vulnerable example
context = new InitialDirContext(env);Because the code fails to neutralize the address string used to construct the query, an attacker can supply an address that includes additional LDAP queries.
Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2021-41232 — Chain: authentication routine in Go-based agile development product does not escape user name (CWE-116), allowing LDAP injection (CWE-90)
- CVE-2005-2301 — Server does not properly escape LDAP queries, which allows remote attackers to cause a DoS and possibly conduct an LDAP injection attack.
Terminology & mappings
Mapped taxonomies
- PLOVER: LDAP injection
- OWASP Top Ten 2007: Injection Flaws (A2) — CWE More Specific fit
- WASC: LDAP Injection (29)
- Software Fault Patterns: Tainted input to command (SFP24)
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-90.
- What is CWE-90?
- The product constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.
- What CVEs are caused by CWE-90?
- 66 recorded CVEs are attributed to CWE-90, including CVE-2026-44930, CVE-2026-33289, CVE-2024-54852.
- Is CWE-90 part of the OWASP Top 10?
- CWE-90 maps to OWASP Top Ten 2007: Injection Flaws (A2) in the OWASP security taxonomy.
- How do you prevent CWE-90?
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- How is CWE-90 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-90?
- Exploiting CWE-90 can lead to: Execute Unauthorized Code or Commands, Read Application Data, Modify Application Data.
- Is CWE-90 actively exploited?
- 66 recorded CVEs are caused by CWE-90; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-90) (opens in a new tab)
- CWE-90 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-90
Get alerted the moment a new CWE-90 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.