<Vulnerability name="CVE-2026-10142">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Moderate</ThreatSeverity>
    <PublicDate>2026-06-10T20:13:11</PublicDate>
    <Bugzilla id="2487704" url="https://bugzilla.redhat.com/show_bug.cgi?id=2487704" xml:lang="en:us">
kafka-python: kafka-python: Denial of Service due to crafted frame length in protocol parser
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>5.9</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-770</CWE>
    <Details xml:lang="en:us" source="Mitre">
kafka-python prior to 2.3.2 contains a denial-of-service vulnerability in the protocol parser that allows a malicious broker or machine-in-the-middle attacker to exhaust memory or hang connections by sending a crafted 4-byte frame length value without bounds validation. Attackers can send a specially crafted frame length through the receive_bytes() function to trigger either a multi-gigabyte memory allocation or an uncaught ValueError that leaves the connection in a broken state, causing requests to hang and consumers to stop heartbeating until restart.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in kafka-python. A malicious broker or a machine-in-the-middle attacker can exploit a denial-of-service vulnerability in the protocol parser. By sending a specially crafted 4-byte frame length value without proper bounds validation, an attacker can trigger excessive memory allocation or cause connections to hang. This can lead to unresponsive requests and consumers failing to heartbeat, resulting in a denial of service.
    </Details>
    <Statement xml:lang="en:us">
A flaw was found in kafka-python. The protocol parser does not validate frame length values, allowing a malicious broker or man-in-the-middle attacker to exhaust memory or hang connections by sending a crafted 4-byte frame length. This can cause multi-gigabyte memory allocation or leave connections in a broken state, causing consumers to stop heartbeating until restart.
    </Statement>
    <Mitigation xml:lang="en:us">
Upgrade to kafka-python 2.3.2 or later. As a workaround, ensure Kafka broker connections use TLS with mutual authentication to prevent man-in-the-middle attacks.
    </Mitigation>
    <PackageState cpe="cpe:/a:redhat:quay:3">
        <ProductName>Red Hat Quay 3</ProductName>
        <FixState>Fix deferred</FixState>
        <PackageName>quay/quay-rhel8</PackageName>
    </PackageState>
    <PackageState cpe="cpe:/a:redhat:quay:3">
        <ProductName>Red Hat Quay 3</ProductName>
        <FixState>Fix deferred</FixState>
        <PackageName>quay/quay-rhel9</PackageName>
    </PackageState>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-10142
https://nvd.nist.gov/vuln/detail/CVE-2026-10142
https://github.com/dpkp/kafka-python/commit/6e4831444f972d169cdd11f5c8d50333cea3f19b
https://github.com/dpkp/kafka-python/pull/3019
https://github.com/dpkp/kafka-python/pull/3026
https://www.vulncheck.com/advisories/kafka-python-prior-to-denial-of-service-via-protocol-parser-frame-length
    </References>
</Vulnerability>