Description
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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Dana Powers | kafka-python | — | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-kafka | 2.0.2-13 | — |
| Debian 13 | python-kafka | No fix yet | — |
| Debian 12 | python-kafka | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | python-kafka | No fix yet | — |
| Ubuntu 26.04 LTS | python-kafka | No fix yet | — |
| Ubuntu 25.10 | python-kafka | No fix yet | — |
| Ubuntu 24.04 LTS | python-kafka | No fix yet | — |
| Ubuntu 22.04 LTS | python-kafka | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | python-kafka | No fix yet | — |
| Ubuntu 18.04 LTS | python-kafka | No fix yet | — |
| Ubuntu 16.04 LTS | python-kafka | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-kafka-python | 2.3.2-1.1 | openSUSE-SU-2026:11004-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | kafka-python | < 2.3.2 | 2.3.2 | GHSA-m3px-q5gj-j9x7 |
Advisories 1
- openSUSE-SU-2026:11004-1 python311-kafka-python-2.3.2-1.1 on GA media SUSE / openSUSE Security Updates · Jun 12, 2026
References
- https://www.vulncheck.com/advisories/kafka-python-prior-to-denial-of-service-via-protocol-parser-frame-length technical-description third-party-advisory
- https://github.com/dpkp/kafka-python/pull/3019 issue-tracking patch
- https://github.com/dpkp/kafka-python/pull/3026 issue-tracking patch
- https://github.com/dpkp/kafka-python/commit/6e4831444f972d169cdd11f5c8d50333cea3f19b patch