cve.bz

CAPEC-136

LDAP Injection

High severityHigh likelihoodStandard pattern

An attacker manipulates or crafts an LDAP query for the purpose of undermining the security of the target. Some applications use user input to create LDAP queries that are processed by an LDAP server. For example, a user might provide their username during authentication and the username might be inserted in an LDAP query during the authentication process. An attacker could use this input to inject additional commands into an LDAP query that could disclose sensitive information. For example, entering a * in the aforementioned query might return information about all users on the system. This attack is very similar to an SQL injection attack in that it manipulates a query to gather additional information or coerce a particular return value.

On this page

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-136: LDAP Injection: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/136.html and https://cve.bz/cve/capec/136?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.

How the attack unfolds

  1. Explore

    The attacker looks for a way in.

    1. [Survey application] The attacker takes an inventory of the entry points of the application.

      2 techniques
      • Spider web sites for all available links
      • Sniff network communications with application using a utility such as WireShark.
  2. Experiment

    They probe what they found.

    1. [Determine user-controllable input susceptible to LDAP injection] For each user-controllable input that the attacker suspects is vulnerable to LDAP injection, attempt to inject characters that have special meaning in LDAP (such as a single quote character, etc.). The goal is to create a LDAP query with an invalid syntax

      3 techniques
      • Use web browser to inject input through text fields or through HTTP GET parameters
      • Use a web application debugging tool such as Tamper Data, TamperIE, WebScarab,etc. to modify HTTP POST parameters, hidden fields, non-freeform fields, or other HTTP header.
      • Use modified client (modified by reverse engineering) to inject input.
    2. [Try to exploit the LDAP injection vulnerability] After determining that a given input is vulnerable to LDAP Injection, hypothesize what the underlying query looks like. Possibly using a tool, iteratively try to add logic to the query to extract information from the LDAP, or to modify or delete information in the LDAP.

      2 techniques
      • Add logic to the LDAP query to change the meaning of that command. Automated tools could be used to generate the LDAP injection strings.
      • Use a web application debugging tool such as Tamper Data, TamperIE, WebScarab,etc. to modify HTTP POST parameters, hidden fields, non-freeform fields, or other HTTP header.

Prerequisites

  • The target application must accept a string as user input, fail to sanitize characters that have a special meaning in LDAP queries in the user input, and insert the user-supplied string in an LDAP query which is then processed.

Skills required

  • Medium skill

    The attacker needs to have knowledge of LDAP, especially its query syntax.

Consequences

What a successful attack can lead to
ImpactAffectsNote
Unreliable ExecutionAvailability
Modify DataIntegrity
Read DataConfidentiality
Execute Unauthorized CommandsAuthorizationRun Arbitrary Code
Gain PrivilegesAccountability, Authentication, Authorization, Non-Repudiation
Bypass Protection MechanismAccess Control, Authorization

Mitigations

  • Strong input validation - All user-controllable input must be validated and filtered for illegal characters as well as LDAP content.

  • Use of custom error pages - Attackers can glean information about the nature of queries from descriptive error messages. Input validation must be coupled with customized error pages that inform about an error without disclosing information about the LDAP or application.

Weaknesses it exploits

  • CWE-20 Improper Input Validation
  • CWE-77 Improper Neutralization of Special Elements used in a Command
  • CWE-90 Improper Neutralization of Special Elements used in an LDAP Query

Recent CVEs with these weaknesses

  1. 8.5CVE-2026-140041

    A flaw has been found in WAVLINK WL-WN530BE1-A M30BE1_V251117. The impacted element is the function FUN_0001f94c of the file /protocol.csp of the component ioos. Executing a manipulation of the argument mac can lead to os command injection…

  2. 8.6CVE-2026-140040

    A vulnerability was detected in WAVLINK WL-WN530BE1-A M30BE1_V251117. The affected element is the function port_forward of the file /protocol.csp of the component ioos. Performing a manipulation of the argument Name results in os command i…

  3. 5.5CVE-2026-139984

    A weakness has been identified in walinejs Waline up to 1.43.6. The affected element is an unknown function of the component OAuth Login Callback Handler. Executing a manipulation of the argument Type can lead to improper input validation.…

  4. 3.7CVE-2026-140099

    Forge, also called node-forge, is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.4, pki.privateKeyFromPem() and pki.privateKeyFromAsn1() ignore the RSAPrivateKey version and otherPrimeInfos fields and inter…

  5. 9.1CVE-2026-137019

    Enclave OS Mini is a Rust-based runtime for confidential applications inside Intel SGX enclaves. Prior to enclave-os-mini-wasm version 0.53.0 and enclave-cluster version 0.8.0, Enclave OS Mini accepted a caller-chosen user_handle during FI…

  6. 8.5CVE-2026-138436

    A vulnerability was identified in TRENDnet TEW-824DRU 1.00b18. Affected by this issue is some unknown functionality of the file /cgi/ssi. The manipulation of the argument syslog_server leads to os command injection. It is possible to initi…

  7. 9.3CVE-2026-138417

    A vulnerability was determined in Tenda AX9 22.03.01.46. This issue affects the function system of the file /goform/setMacFilterCfg of the component Web Management Backend. Executing a manipulation of the argument macFilterType can lead to…

  8. 8.6CVE-2026-138416

    A vulnerability was found in D-Link R15 1.22.01. This vulnerability affects the function save_CSID_SetDeviceSettings of the file /bin/httpd of the component DHMAPI. Performing a manipulation of the argument TZLocation results in command in…

The newest records naming one of them. Each weakness's page lists them all.

Part of

Examples

PowerDNS before 2.9.18, when running with an LDAP backend, does not properly escape LDAP queries, which allow…

PowerDNS before 2.9.18, when running with an LDAP backend, does not properly escape LDAP queries, which allows remote attackers to cause a denial of service (failure to answer ldap questions) and possibly conduct an LDAP injection attack. See also: CVE-2005-2301

MITRE's words, unchanged: CAPEC-136 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.