CVE-2024-56128 Apache Kafka: SCRAM authentication vulnerable to replay attacks when used without encryption

Medium 5.3 Published Updated

Attackers can bypass SCRAM authentication via replay attacks if Kafka is configured without TLS encryption, allowing unauthorized access.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-56128?

CVE-2024-56128 is a medium-severity authentication bypass vulnerability in Apache Kafka, published on 18 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Incorrect Implementation of Authentication Algorithm in Apache Kafka's SCRAM implementation.

Issue Summary: Apache Kafka's implementation of the Salted Challenge Response Authentication Mechanism (SCRAM) did not fully adhere to the requirements of RFC 5802 [1]. Specifically, as per RFC 5802, the server must verify that the nonce sent by the client in the second message matches the nonce sent by the server in its first message. However, Kafka's SCRAM implementation did not perform this validation.

Impact: This vulnerability is exploitable only when an attacker has plaintext access to the SCRAM authentication exchange. However, the usage of SCRAM over plaintext is strongly discouraged as it is considered an insecure practice [2]. Apache Kafka recommends deploying SCRAM exclusively with TLS encryption to protect SCRAM exchanges from interception [3]. Deployments using SCRAM with TLS are not affected by this issue.

How to Detect If You Are Impacted: If your deployment uses SCRAM authentication over plaintext communication channels (without TLS encryption), you are likely impacted. To check if TLS is enabled, review your server.properties configuration file for listeners property. If you have SASL_PLAINTEXT in the listeners, then you are likely impacted.

Fix Details: The issue has been addressed by introducing nonce verification in the final message of the SCRAM authentication exchange to ensure compliance with RFC 5802.

Affected Versions: Apache Kafka versions 0.10.2.0 through 3.9.0, excluding the fixed versions below.

Fixed Versions: 3.9.0 3.8.1 3.7.2

Users are advised to upgrade to 3.7.2 or later to mitigate this issue.

Recommendations for Mitigation: Users unable to upgrade to the fixed versions can mitigate the issue by: - Using TLS with SCRAM Authentication: Always deploy SCRAM over TLS to encrypt authentication exchanges and protect against interception. - Considering Alternative Authentication Mechanisms: Evaluate alternative authentication mechanisms, such as PLAIN, Kerberos or OAuth with TLS, which provide additional layers of security.

Weakness: CWE-303

Which versions are affected by CVE-2024-56128?

13 open source packages ship an affected version, including org.apache.kafka:kafka_2.12, kafka and org.apache.kafka:kafka_2.10. It affects 1 product.

PackageAffectedFixed in
org.apache.kafka:kafka_2.12 MavenFrom 0.10.2.03.7.2
org.apache.kafka:kafka_2.12 MavenFrom 0.10.2.03.7.2
org.apache.kafka:kafka_2.12 MavenFrom 3.8.03.8.1
org.apache.kafka:kafka_2.12 MavenFrom 3.8.03.8.1
kafka BitnamiFrom 3.8.03.8.1, 3.7.2
org.apache.kafka:kafka_2.10 MavenFrom 0.10.2.0 to 0.10.2.2None
7 more packages
org.apache.kafka:kafka_2.10 MavenFrom 0.10.2.0 to 0.10.2.2None
org.apache.kafka:kafka_2.11 MavenFrom 0.10.2.0 to 2.4.1None
org.apache.kafka:kafka_2.11 MavenFrom 0.10.2.0 to 2.4.1None
org.apache.kafka:kafka_2.13 MavenFrom 0.10.2.03.7.2
org.apache.kafka:kafka_2.13 MavenFrom 0.10.2.03.7.2
org.apache.kafka:kafka_2.13 MavenFrom 3.8.03.8.1
org.apache.kafka:kafka_2.13 MavenFrom 3.8.03.8.1

Products include Apache Kafka.

How do I fix CVE-2024-56128?

Upgrade org.apache.kafka:kafka_2.12 to a fixed version for your release line: 3.7.2 or 3.8.1.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2024-56128 being exploited?

There is no known exploitation of CVE-2024-56128 in the wild and no public exploit code.

Sources

Also known as BIT-kafka-2024-56128, GHSA-p7c9-8xx8-h74f, MINI-c57p-3hmh-4fg3, MINI-jxrg-gxh8-qxx8, ROOT-APP-MAVEN-CVE-2024-56128.

Is CVE-2024-56128 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free