# CVE-2024-31141: Apache Kafka Clients: Privilege escalation to filesystem read-access via automatic ConfigProvider

> Attackers with untrusted configuration access can use ConfigProviders to read arbitrary files and environment variables, escalating privileges.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Nov 2024
- **Updated:** 31 Jan 2025
- **Also known as:** ECHO-e4df-4158-934d, GHSA-2x2g-32r7-p4x8, MINI-m6j4-2w5m-gvf9, MINI-wx4r-mfr9-v5rm, ROOT-APP-MAVEN-CVE-2024-31141

## What is CVE-2024-31141?

CVE-2024-31141 is a medium-severity vulnerability in Apache Kafka Clients, published on 19 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Files or Directories Accessible to External Parties, Improper Privilege Management vulnerability in Apache Kafka Clients.

Apache 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.
In 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.

In 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.
This issue affects Apache Kafka Clients: from 2.3.0 through 3.5.2, 3.6.2, 3.7.0.

Users 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".
Users 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.

For 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.
For 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.

Weakness: CWE-552 (Files or Directories Accessible to External Parties), CWE-269 (Improper Privilege Management)

## Which versions are affected by CVE-2024-31141?

2 open source packages ship an affected version, including org.apache.kafka:kafka-clients. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.kafka:kafka-clients` | Maven | From 2.3.0 | 3.7.1 |
| `org.apache.kafka:kafka-clients` | Maven | From 2.3.0 | 3.7.1 |

Products: Apache Kafka.

## How do I fix CVE-2024-31141?

Upgrade org.apache.kafka:kafka-clients to 3.7.1 or later.

## Is CVE-2024-31141 being exploited?

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

## Other vulnerabilities in Apache Kafka Clients

- [CVE-2026-33557](https://insights.sbomify.com/CVE-2026-33557/): Apache Kafka: Missing JWT token validation in OAUTHBEARER authentication (critical 9.1)
- [CVE-2025-27818](https://insights.sbomify.com/CVE-2025-27818/): Apache Kafka: Possible RCE attack via SASL JAAS LdapLoginModule configuration (high 8.8)
- [CVE-2018-17196](https://insights.sbomify.com/CVE-2018-17196/): Improper Input Validation in Apache Kafka (high 8.8)
- [CVE-2026-35554](https://insights.sbomify.com/CVE-2026-35554/): Apache Kafka Clients: Kafka Producer Message Corruption and Misrouting via Buffer Pool Race Condition (high 8.7)
- [CVE-2025-27817](https://insights.sbomify.com/CVE-2025-27817/): Apache Kafka Client: Arbitrary file read and SSRF vulnerability (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-31141 and fix it if it is affected.

What it is: CVE-2024-31141 is a medium-severity vulnerability in Apache Kafka Clients, published on 19 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-31141 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.kafka:kafka-clients (Maven): affected from 2.3.0; fixed in 3.7.1
- org.apache.kafka:kafka-clients (Maven): affected from 2.3.0; fixed in 3.7.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-31141/ (Markdown: https://insights.sbomify.com/CVE-2024-31141/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-31141
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-31141
- OSV: https://osv.dev/vulnerability/CVE-2024-31141

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-31141/
Summaries are generated and may contain mistakes; the official description above is the record.
