CVE-2024-31141: Apache Kafka Clients Privilege Escalation To Filesystem Read-access Vulnerability
MODERATECVE-2024-31141 is a MODERATE (CVSS 6.5) privilege escalation to filesystem read-access vulnerability (CWE-269: Improper Privilege Management) affecting Apache Kafka Clients libraries in the Maven ecosystem. The issue involves privilege escalation to filesystem read-access via automatic configprovider. Remediation is available by upgrading affected packages to version 3.7.1.
CVE-2024-31141 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-31141
To remediate this vulnerability, upgrade all affected Apache Kafka Clients dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>3.7.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.kafka
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-31141, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.kafka
Analyze the terminal output to locate any version of Apache Kafka Clients in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.kafka command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Apache Kafka Clients, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-31141 Affected Apache Kafka Clients Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.kafka:kafka-clients
|
Maven |
≥ 2.3.0
< 3.7.1
|
3.7.1
|
References
Frequently Asked Questions
What is CVE-2024-31141?
Which Apache Kafka Clients versions are affected?
What version fixes CVE-2024-31141?
Is kafka-clients affected?
What is the CVSS score of CVE-2024-31141?
What CWE is associated with CVE-2024-31141?
How can I check Maven dependencies for CVE-2024-31141?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2x2g-32r7-p4x8",
"modified" : "2025-02-18T21:00:05Z",
"published" : "2024-11-19T09:30:54Z",
"aliases" : [ "CVE-2024-31141" ],
"summary" : "Apache Kafka Clients: Privilege escalation to filesystem read-access via automatic ConfigProvider",
"details" : "Files or Directories Accessible to External Parties, Improper Privilege Management vulnerability in Apache Kafka Clients.\n\nApache Kafka Clients accept configuration data for customizing behavior, and includes ConfigProvider plugins in order to manipulate these configurations. Apache Kafka also provides FileConfigProvider, DirectoryConfigProvider, and EnvVarConfigProvider implementations which include the ability to read from disk or environment variables.\nIn applications where Apache Kafka Clients configurations can be specified by an untrusted party, attackers may use these ConfigProviders to read arbitrary contents of the disk and environment variables.\n\nIn particular, this flaw may be used in Apache Kafka Connect to escalate from REST API access to filesystem/environment access, which may be undesirable in certain environments, including SaaS products.\nThis issue affects Apache Kafka Clients: from from 2.3.0 through 3.5.2, 3.6.0 through 3.6.2, and 3.7.0.\n\n\nUsers with affected applications are recommended to upgrade kafka-clients to version >=3.8.0, and set the JVM system property \"org.apache.kafka.automatic.config.providers=none\".\nUsers of Kafka Connect with one of the listed ConfigProvider implementations specified in their worker config are also recommended to add appropriate \"allowlist.pattern\" and \"allowed.paths\" to restrict their operation to appropriate bounds.\n\n\nFor users of Kafka Clients or Kafka Connect in environments that trust users with disk and environment variable access, it is not recommended to set the system property.\nFor users of the Kafka Broker, Kafka MirrorMaker 2.0, Kafka Streams, and Kafka command-line tools, it is not recommended to set the system property.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.kafka:kafka-clients"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.0"
}, {
"fixed" : "3.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-31141"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/kafka"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread/9whdzfr0zwdhr364604w5ssnzmg4v2lv"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20250131-0001"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2024/11/18/5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-269" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-19T18:02:57Z",
"nvd_published_at" : "2024-11-19T09:15:03Z"
}
}