CVE-2024-31141
Apache Kafka Clients: Privilege escalation to filesystem read-access via automatic ConfigProvider
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 from 2.3.0 through 3.5.2, 3.6.0 through 3.6.2, and 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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.apache.kafka » kafka-clients | >= 2.3.0, < 3.7.1 | 3.7.1 |
Blast radius
51% of the dependent artifacts (3,054) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 62,018 |
| 2 hops | 74,183 |
| 3 hops | 48,555 |
| 4 hops | 16,065 |
| 5 hops | 4,538 |
| 6 hops | 880 |
Most used dependents
- org.apache.spark » spark-sql3,174 usages
- org.apache.spark » spark-core2,899 usages
- org.apache.kafka » kafka1,450 usages
- org.springframework.kafka » spring-kafka1,063 usages
- org.apache.kafka » connect-api1,026 usages
- org.apache.spark » spark-mllib831 usages
- org.apache.hive » hive-exec699 usages
- org.apache.spark » spark-streaming670 usages
- org.apache.kafka » connect-transforms659 usages
- org.apache.spark » spark-hive633 usages
- org.apache.camel.kafkaconnector » camel-kafka-connector616 usages
- org.apache.camel.springboot » camel-core-starter558 usages
- org.apache.kafka » kafka-streams513 usages
- org.apache.spark » spark-catalyst502 usages
- org.apache.hive » hive-metastore480 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
