Vulnerabilities in pkg:maven/org.apache.kafka/kafka
PACKAGECVE-2022-34917 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-789: Memory Allocation with Excessive Size Value) affecting Kafka libraries in the Maven ecosystem. The issue involves apache kafka vulnerability can lead to brokers hitting outofmemoryexception, causing denial of service. Remediation is available by upgrading affected packages to version 2.8.2, 3.0.2, 3.1.2, 3.2.3.
pkg:maven/org.apache.kafka/kafka
Vulnerability advisories affecting package pkg:maven/org.apache.kafka/kafka. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-c9h3-c6qj-hh7q | CVE-2022-34917 | HIGH | Apache Kafka vulnerability can lead to brokers hitting OutOfMemoryException, causing Denial of Service |
| GHSA-gh27-38p5-mrxc | CVE-2018-1288 | MODERATE | Improper Control of Generation of Code in Apache Kafka |
| GHSA-47w3-66wq-cpxg | CVE-2018-17196 | HIGH | Improper Input Validation in Apache Kafka |
| GHSA-6jmf-mxwf-r3jc | CVE-2019-12399 | HIGH | Exposure of Sensitive Information to an Unauthorized Actor in Apache Kafka |
CVE-2022-34917 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-34917
To remediate this vulnerability, upgrade all affected Kafka 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</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka</artifactId>
<version>3.2.3</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-2022-34917, 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 Kafka in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.2), 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-789: Memory Allocation with Excessive Size Value, where the product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated. In Kafka, 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-2022-34917 Affected Kafka Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.kafka:kafka
|
Maven |
≥ 2.8.0
< 2.8.2
|
2.8.2
|
|
org.apache.kafka:kafka
|
Maven |
≥ 3.0.0
< 3.0.2
|
3.0.2
|
|
org.apache.kafka:kafka
|
Maven |
≥ 3.1.0
< 3.1.2
|
3.1.2
|
|
org.apache.kafka:kafka
|
Maven |
≥ 3.2.0
< 3.2.3
|
3.2.3
|
References
Frequently Asked Questions
What is CVE-2022-34917?
Which Kafka versions are affected?
What version fixes CVE-2022-34917?
Is kafka affected?
What is the CVSS score of CVE-2022-34917?
What CWE is associated with CVE-2022-34917?
How can I check Maven dependencies for CVE-2022-34917?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c9h3-c6qj-hh7q",
"modified" : "2024-05-08T17:44:34Z",
"published" : "2022-09-21T00:00:52Z",
"aliases" : [ "CVE-2022-34917" ],
"summary" : "Apache Kafka vulnerability can lead to brokers hitting OutOfMemoryException, causing Denial of Service",
"details" : "A security vulnerability has been identified in Apache Kafka. It affects all releases since 2.8.0. The vulnerability allows malicious unauthenticated clients to allocate large amounts of memory on brokers. This can lead to brokers hitting OutOfMemoryException and causing denial of service. Example scenarios: - Kafka cluster without authentication: Any clients able to establish a network connection to a broker can trigger the issue. - Kafka cluster with SASL authentication: Any clients able to establish a network connection to a broker, without the need for valid SASL credentials, can trigger the issue. - Kafka cluster with TLS authentication: Only clients able to successfully authenticate via TLS can trigger the issue. We advise the users to upgrade the Kafka installations to one of the 3.2.3, 3.1.2, 3.0.2, 2.8.2 versions.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.kafka:kafka"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.0"
}, {
"fixed" : "2.8.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.kafka:kafka"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.0.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.kafka:kafka"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.1.0"
}, {
"fixed" : "3.1.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.kafka:kafka"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.2.0"
}, {
"fixed" : "3.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-34917"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/kafka/commit/14951a83e3fdead212156e5532359500d72f68bc"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/kafka/commit/2bfa24b2bd416e7b8c4a0c566b984c43904fdecb"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/kafka/commit/aaceb6b79bfcb1d32874ccdbc8f3138d1c1c00fb"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/kafka/commit/c1295662768e64b4467e27c3d5158f95f2307657"
}, {
"type" : "WEB",
"url" : "https://issues.apache.org/jira/browse/KAFKA-14063"
}, {
"type" : "WEB",
"url" : "https://kafka.apache.org/cve-list"
}, {
"type" : "WEB",
"url" : "https://kafka.apache.org/cve-list#CVE-2022-34917"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-770", "CWE-789" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-21T21:15:52Z",
"nvd_published_at" : "2022-09-20T09:15:00Z"
}
}