Description
An integer underflow vulnerability was found in MIT krb5 in the berval2tl_data() function in plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c. The function performs an unsigned subtraction (bv_len - 2) without a prior bounds check. When bv_len is 0 or 1, the subtraction wraps to a large value which is then truncated to uint16_t, yielding 0xFFFE (65534) or 0xFFFF (65535). The subsequent malloc succeeds and memcpy reads up to 65534 bytes from a 0-1 byte buffer, resulting in a heap out-of-bounds read. The attack vector involves a malicious or compromised LDAP KDB backend returning a krbExtraData attribute with bv_len < 2, triggering the underflow when the KDC or kadmind reads principal data.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Red Hat Red Hat Hardened Images
Default version status: affected
1.22.2-8.hum1 to < *unaffected
Red Hat Red Hat Enterprise Linux 10
Default version status: affected
Red Hat Red Hat Enterprise Linux 6
Default version status: affected
Red Hat Red Hat Enterprise Linux 7
Default version status: affected
Red Hat Red Hat Enterprise Linux 8
Default version status: affected
Red Hat Red Hat Enterprise Linux 9
Default version status: affected
Red Hat Red Hat OpenShift Container Platform 4
Default version status: affected
Red Hat Red Hat OpenShift Container Platform 4
Default version status: affected