CVE-2023-22946: Spark core 2.12 Apache Spark Vulnerable To Improper Vulnerability

CRITICAL
Advisory Identifier: GHSA-329j-jfvr-rhr6
CVSS 9.9
CWE-269
Published
Advisory Summary

CVE-2023-22946 is a CRITICAL (CVSS 9.9) apache spark vulnerable to improper vulnerability (CWE-269: Improper Privilege Management) affecting Spark core 2.12 libraries in the Maven ecosystem. The issue involves apache spark vulnerable to improper privilege management. Remediation is available by upgrading affected packages to version 3.3.3, 3.3.2.

CVE-2023-22946 at a Glance

CVE Identifier CVE-2023-22946
GHSA Identifier GHSA-329j-jfvr-rhr6
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-269: Improper Privilege Management
Affected Product Spark core 2.12
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.9

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

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

How to Fix CVE-2023-22946

To remediate this vulnerability, upgrade all affected Spark core 2.12 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_2.12 fixed: 3.3.3
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core_2.12</artifactId>
    <version>3.3.3</version>
</dependency>
org.apache.spark:spark-core_2.13 fixed: 3.3.3
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core_2.13</artifactId>
    <version>3.3.3</version>
</dependency>
pyspark fixed: 3.3.2
pip install pyspark>=3.3.2
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-2023-22946, 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 2.12 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Spark core 2.12, 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 Spark versions prior to versions 3.4.0 and 3.3.3, applications using spark-submit can specify a `proxy-user` to run as, limiting privileges. The application can execute code with the privileges of the submitting user, however, by providing malicious configuration-related classes on the classpath. This affects architectures relying on proxy-user, for example those using Apache Livy to manage submitted applications. Update to Apache Spark 3.4.0, 3.3.3, or later, and ensure that spark.submit.proxyUser.allowCustomClasspathInClusterMode is set to its default of "false", and is not overridden by submitted applications.

CVE-2023-22946 Affected Spark core 2.12 Versions

3 component(s)
Fixed Versions:
3.3.33.3.2
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.spark:spark-core_2.12
Maven
< 3.3.3
3.3.3
org.apache.spark:spark-core_2.13
Maven
< 3.3.3
3.3.3
pyspark
PyPI
< 3.3.2
3.3.2

References

Frequently Asked Questions

What is CVE-2023-22946?
CVE-2023-22946 is a security vulnerability in Spark core 2.12 involving Apache Spark vulnerable to Improper Privilege Management under CWE-269: Improper Privilege Management.
Which Spark core 2.12 versions are affected?
Affected versions include releases prior to 3.3.3, 3.3.2 across affected packages: org.apache.spark:spark-core_2.12, org.apache.spark:spark-core_2.13, pyspark.
What version fixes CVE-2023-22946?
Upgrading to 3.3.3, 3.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spark-core_2.12 affected?
Yes, org.apache.spark:spark-core_2.12 is affected in releases prior to 3.3.3. Upgrade your dependency to 3.3.3 or later.
Is spark-core_2.13 affected?
Yes, org.apache.spark:spark-core_2.13 is affected in releases prior to 3.3.3. Upgrade your dependency to 3.3.3 or later.
What is the CVSS score of CVE-2023-22946?
CVE-2023-22946 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2023-22946?
CVE-2023-22946 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Maven dependencies for CVE-2023-22946?
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-329j-jfvr-rhr6",
  "modified" : "2024-10-15T18:43:45Z",
  "published" : "2023-04-17T09:30:23Z",
  "aliases" : [ "CVE-2023-22946" ],
  "summary" : "Apache Spark vulnerable to Improper Privilege Management",
  "details" : "In Apache Spark versions prior to versions 3.4.0 and 3.3.3, applications using spark-submit can specify a `proxy-user` to run as, limiting privileges. The application can execute code with the privileges of the submitting user, however, by providing malicious configuration-related classes on the classpath. This affects architectures relying on proxy-user, for example those using Apache Livy to manage submitted applications.\n\nUpdate to Apache Spark 3.4.0, 3.3.3, or later, and ensure that spark.submit.proxyUser.allowCustomClasspathInClusterMode is set to its default of \"false\", and is not overridden by submitted applications.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.spark:spark-core_2.12"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.3.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.spark:spark-core_2.13"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.3.2"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyspark"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22946"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/spark/pull/39474"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/spark/pull/41428"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/spark/commit/909da96e1471886a01a9e1def93630c4fd40e74a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/degant/spark/commit/bfba57724d2520e0fcaa7990f7257c21d11cd75a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/spark"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pyspark/PYSEC-2023-44.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/SPARK-41958"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/yllfl25xh5tbotjmg93zrq4bzwhqc0gv"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-21T20:37:59Z",
    "nvd_published_at" : "2023-04-17T08:15:00Z"
  }
}