A heap buffer overflow flaw was found in the SASL I/O layer of 389 Directory Server
(389-ds-base). After a successful SASL bind with integrity protection (SSF > 0),
an authenticated attacker can send a specially crafted oversized LDAP UNBIND packet
that is copied into a 512-byte heap receive buffer without a bounds check in
sasl_io_recv() in sasl_io.c. This allows up to approximately 2 megabytes of
attacker-controlled data to overflow the buffer, causing a denial of service (server
crash). In FreeIPA and Red Hat Identity Management deployments, any domain user with
a valid Kerberos ticket, any enrolled host, or any service account can trigger this
vulnerability over the network after authenticating via GSSAPI.
The vulnerable code path has existed since approximately 2013 (389-ds-base 1.3.2) and
was not addressed by the CVE-2025-14905 fix, which patched a separate heap overflow
in schema.c only.
There is no complete workaround for this flaw.
Mitigations that reduce exposure:
1. Restrict network access to LDAP ports (389/636) to trusted networks only.
Note: In FreeIPA/IdM deployments, enrolled clients require LDAP access and
this may not be practical.
2. If DIGEST-MD5 is not required, disable it via nsslapd-allowed-sasl-mechanisms
in cn=config. GSSAPI/Kerberos cannot be disabled in FreeIPA/IdM without breaking
domain authentication.
3. Monitor for oversized LDAP UNBIND packets (standard UNBIND is 7 bytes; alert on
UNBIND packets exceeding ~100 bytes).
4. Lowering nsslapd-maxbersize reduces maximum overflow size but does not eliminate
the vulnerability.