Vulnerabilities in pkg:maven/org.apache.spark/spark-core

PACKAGE
Advisory Identifier: GHSA-9rr6-jpg7-9jg6
Advisory Summary

CVE-2021-38296 is a HIGH (CVSS 7.5) authentication bypass vulnerability (CWE-294: Authentication Bypass by Capture-replay) affecting Spark core libraries in the Maven ecosystem. The issue involves authentication bypass by capture-replay in apache spark. Remediation is available by upgrading affected packages to version 3.1.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.spark/spark-core

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.spark/spark-core. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9rr6-jpg7-9jg6 CVE-2021-38296 HIGH Authentication Bypass by Capture-replay in Apache Spark

CVE-2021-38296 at a Glance

CVE Identifier CVE-2021-38296
GHSA Identifier GHSA-9rr6-jpg7-9jg6
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-294: Authentication Bypass by Capture-replay
Affected Product Spark core
Package Ecosystem Maven
Published Date
Last Updated

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

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

How to Fix CVE-2021-38296

To remediate this vulnerability, upgrade all affected Spark core 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.spark:spark-core fixed: 3.1.3
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core</artifactId>
    <version>3.1.3</version>
</dependency>
pyspark fixed: 3.1.3
pip install pyspark>=3.1.3
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.spark

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-38296, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.spark

Analyze the terminal output to locate any version of Spark core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.spark 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-294: Authentication Bypass by Capture-replay, where a capture-replay flaw exists when the design of the product makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes). In Spark core, 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

Apache Spark supports end-to-end encryption of RPC connections via "spark.authenticate" and "spark.network.crypto.enabled". In versions 3.1.2 and earlier, it uses a bespoke mutual authentication protocol that allows for full encryption key recovery. After an initial interactive attack, this would allow someone to decrypt plaintext traffic offline. Note that this does not affect security mechanisms controlled by "spark.authenticate.enableSaslEncryption", "spark.io.encryption.enabled", "spark.ssl", "spark.ui.strictTransportSecurity". Update to Apache Spark 3.1.3 or later

CVE-2021-38296 Affected Spark core Versions

2 component(s)
Fixed Versions:
3.1.3
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.spark:spark-core
Maven
< 3.1.3
3.1.3
pyspark
PyPI
< 3.1.3
3.1.3

References

Frequently Asked Questions

What is CVE-2021-38296?
CVE-2021-38296 is a security vulnerability in Spark core involving Authentication Bypass by Capture-replay in Apache Spark under CWE-294: Authentication Bypass by Capture-replay.
Which Spark core versions are affected?
Affected versions include releases prior to 3.1.3 across affected packages: org.apache.spark:spark-core, pyspark.
What version fixes CVE-2021-38296?
Upgrading to 3.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spark-core affected?
Yes, org.apache.spark:spark-core is affected in releases prior to 3.1.3. Upgrade your dependency to 3.1.3 or later.
Is pyspark affected?
Yes, pyspark is affected in releases prior to 3.1.3. Upgrade your dependency to 3.1.3 or later.
What is the CVSS score of CVE-2021-38296?
CVE-2021-38296 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-38296?
CVE-2021-38296 is classified under CWE-294: Authentication Bypass by Capture-replay (A capture-replay flaw exists when the design of the product makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes).).
How can I check Maven dependencies for CVE-2021-38296?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.spark'. 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-9rr6-jpg7-9jg6",
  "modified" : "2024-10-25T20:49:39Z",
  "published" : "2022-03-11T00:02:36Z",
  "aliases" : [ "CVE-2021-38296" ],
  "summary" : "Authentication Bypass by Capture-replay in Apache Spark",
  "details" : "Apache Spark supports end-to-end encryption of RPC connections via \"spark.authenticate\" and \"spark.network.crypto.enabled\". In versions 3.1.2 and earlier, it uses a bespoke mutual authentication protocol that allows for full encryption key recovery. After an initial interactive attack, this would allow someone to decrypt plaintext traffic offline. Note that this does not affect security mechanisms controlled by \"spark.authenticate.enableSaslEncryption\", \"spark.io.encryption.enabled\", \"spark.ssl\", \"spark.ui.strictTransportSecurity\". Update to Apache Spark 3.1.3 or later",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.spark:spark-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyspark"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-38296"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-9rr6-jpg7-9jg6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pyspark/PYSEC-2022-186.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/70x8fw2gx3g9ty7yk0f2f1dlpqml2smd"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-294" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-11T20:30:09Z",
    "nvd_published_at" : "2022-03-10T09:15:00Z"
  }
}