VDB
Sign up

PYSEC-2026-2191

Quick fix

PYSEC-2026-2191 — kafka-python: upgrade to the fixed version with the command below.

pip install --upgrade 'kafka-python>=2.3.2'

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/kafka-python
Introduced in: 0Fixed in: 2.3.2
Fixpip install --upgrade 'kafka-python>=2.3.2'

References