Description
kafka-python prior to 2.3.2 contains a denial-of-service vulnerability in SCRAM authentication handling that allows a malicious or machine-in-the-middle broker to freeze the client event loop by supplying an excessively large iteration count. In scram.py, ScramClient.process_server_first_message() passes the broker-controlled SCRAM iteration count directly to hashlib.pbkdf2_hmac() without validation, blocking producer sends, consumer polls, admin operations, and heartbeats, which can cause consumer group eviction and repeated reconnect failures.
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-12 | — |
| 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 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | kafka-python | < 2.3.2 | 2.3.2 | GHSA-2jcm-hq8r-84wx |
References
- https://github.com/dpkp/kafka-python/pull/3019 issue-tracking patch
- https://github.com/dpkp/kafka-python/commit/6e4831444f972d169cdd11f5c8d50333cea3f19b patch
- https://github.com/dpkp/kafka-python/pull/3026 issue-tracking patch
- https://www.vulncheck.com/advisories/kafka-python-prior-to-dos-via-scram-iteration-count-in-scram-py third-party-advisory