Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-90 (LDAP查询中使用的特殊元素转义处理不恰当(LDAP注入)) — Vulnerability Class 40

40 vulnerabilities classified as CWE-90 (LDAP查询中使用的特殊元素转义处理不恰当(LDAP注入)). AI Chinese analysis included.

CWE-90 represents a critical input validation weakness where applications construct Lightweight Directory Access Protocol queries using untrusted user data without properly sanitizing special characters. Attackers typically exploit this vulnerability by injecting malicious LDAP syntax, such as logical operators or wildcards, into input fields like usernames or search filters. This manipulation allows adversaries to bypass authentication mechanisms, extract sensitive directory information, or alter query logic to gain unauthorized access. To prevent LDAP injection, developers must strictly enforce input validation by rejecting unexpected characters and employing parameterized queries or safe API wrappers that treat user input as data rather than executable code. Additionally, implementing least-privilege principles for service accounts and conducting regular code reviews ensures that dynamic query construction remains secure against malicious manipulation.

MITRE CWE Description
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.
Common Consequences (1)
Confidentiality, Integrity, AvailabilityExecute Unauthorized Code or Commands, Read Application Data, Modify Application Data
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.
Mitigations (1)
ImplementationAssume 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…
Examples (1)
The code below constructs an LDAP query using user input address data:
context = new InitialDirContext(env); String searchFilter = "StreetAddress=" + address; NamingEnumeration answer = context.search(searchBase, searchFilter, searchCtls);
Bad · Java

Vulnerabilities classified as CWE-90 (LDAP查询中使用的特殊元素转义处理不恰当(LDAP注入)) represent 40 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.