CVE-2018-1288: Kafka Improper Control Of Generation Of Vulnerability

MODERATE
Advisory Identifier: GHSA-gh27-38p5-mrxc
CVSS 5.4
CWE-94
Published
Advisory Summary

CVE-2018-1288 is a MODERATE (CVSS 5.4) improper control of generation of vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Kafka libraries in the Maven ecosystem. The issue involves improper control of generation of code in apache kafka. Remediation is available by upgrading affected packages to version 0.10.2.2, 0.11.0.3, 1.0.1.

CVE-2018-1288 at a Glance

CVE Identifier CVE-2018-1288
GHSA Identifier GHSA-gh27-38p5-mrxc
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Kafka
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2018-1288

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.

org.apache.kafka:kafka fixed: 0.10.2.2
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka</artifactId>
    <version>0.10.2.2</version>
</dependency>
org.apache.kafka:kafka fixed: 0.11.0.3
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka</artifactId>
    <version>0.11.0.3</version>
</dependency>
org.apache.kafka:kafka fixed: 1.0.1
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka</artifactId>
    <version>1.0.1</version>
</dependency>
Verify Direct and Transitive Dependencies

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-2018-1288, 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 0.10.2.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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. 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

In Apache Kafka 0.9.0.0 to 0.9.0.1, 0.10.0.0 to 0.10.2.1, 0.11.0.0 to 0.11.0.2, and 1.0.0, authenticated Kafka users may perform action reserved for the Broker via a manually created fetch request interfering with data replication, resulting in data loss.

CVE-2018-1288 Affected Kafka Versions

3 component(s)
Fixed Versions:
0.10.2.20.11.0.31.0.1
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.kafka:kafka
Maven
≥ 0.9.0.0
< 0.10.2.2
0.10.2.2
org.apache.kafka:kafka
Maven
≥ 0.11.0.0
< 0.11.0.3
0.11.0.3
org.apache.kafka:kafka
Maven
≥ 1.0.0
< 1.0.1
All 1 versions
1.0.0
1.0.1

References

NVD — CVE-2018-1288 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-1288
access.redhat.com/errata/rhsa-2018:37... WEB
https://access.redhat.com/errata/RHSA-2018:3768
lists.apache.org/thread.html/29f6133... WEB
https://lists.apache.org/thread.html/29f61337323f48c47d4b41d74b9e452bd60e65d0e5103af9a6bb2fef@%3Cusers.kafka.apache.org%3E
lists.apache.org/thread.html/519eb0f... WEB
https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3E
lists.apache.org/thread.html/b0656d3... WEB
https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3E
lists.apache.org/thread.html/d1581fb... WEB
https://lists.apache.org/thread.html/d1581fb6464c9bec8a72575c01f5097d68e2fbb230aff24622622a58@%3Ccommits.kafka.apache.org%3E
lists.apache.org/thread.html/f9bc3e5... WEB
https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3E
lists.apache.org/thread.html/r07e1bb... WEB
https://lists.apache.org/thread.html/r07e1bbd1643847d599feb34c707906a4fdcc81e3a6ab01a10c451d40@%3Cissues.flink.apache.org%3E
lists.apache.org/thread.html/r35322a... WEB
https://lists.apache.org/thread.html/r35322aec467ddae34002690edaa4d9f16e7df9b5bf7164869b75b62c@%3Cdev.kafka.apache.org%3E
Kafka Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2020.html
Kafka Security Information SECURITY
http://www.securityfocus.com/bid/104900

Frequently Asked Questions

What is CVE-2018-1288?
CVE-2018-1288 is a security vulnerability in Kafka involving Improper Control of Generation of Code in Apache Kafka under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Kafka versions are affected?
Affected versions include releases prior to 0.10.2.2, 0.11.0.3, 1.0.1 across affected packages: org.apache.kafka:kafka.
What version fixes CVE-2018-1288?
Upgrading to 0.10.2.2, 0.11.0.3, 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kafka affected?
Yes, org.apache.kafka:kafka is affected in releases prior to 0.10.2.2, 0.11.0.3, 1.0.1. Upgrade your dependency to 0.10.2.2, 0.11.0.3, 1.0.1 or later.
What is the CVSS score of CVE-2018-1288?
CVE-2018-1288 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2018-1288?
CVE-2018-1288 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Maven dependencies for CVE-2018-1288?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.kafka'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gh27-38p5-mrxc",
  "modified" : "2022-06-29T22:43:46Z",
  "published" : "2022-05-13T01:02:18Z",
  "aliases" : [ "CVE-2018-1288" ],
  "summary" : "Improper Control of Generation of Code in Apache Kafka",
  "details" : "In Apache Kafka 0.9.0.0 to 0.9.0.1, 0.10.0.0 to 0.10.2.1, 0.11.0.0 to 0.11.0.2, and 1.0.0, authenticated Kafka users may perform action reserved for the Broker via a manually created fetch request interfering with data replication, resulting in data loss.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.kafka:kafka"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.0.0"
      }, {
        "fixed" : "0.10.2.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.10.2.1"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.kafka:kafka"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.11.0.0"
      }, {
        "fixed" : "0.11.0.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.11.0.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.kafka:kafka"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ],
    "versions" : [ "1.0.0" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1288"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3768"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/29f61337323f48c47d4b41d74b9e452bd60e65d0e5103af9a6bb2fef@%3Cusers.kafka.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/d1581fb6464c9bec8a72575c01f5097d68e2fbb230aff24622622a58@%3Ccommits.kafka.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r07e1bbd1643847d599feb34c707906a4fdcc81e3a6ab01a10c451d40@%3Cissues.flink.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r35322aec467ddae34002690edaa4d9f16e7df9b5bf7164869b75b62c@%3Cdev.kafka.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2020.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/104900"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-29T22:43:46Z",
    "nvd_published_at" : "2018-07-26T14:29:00Z"
  }
}