Actively exploited · Published Jul 18, 2022 · Assigned by apache

CVE-2022-33891Apache Spark shell command injection vulnerability via Spark UI

High 8.8 Exploited

In plain English

A high-severity OS command injection in Apache Spark from Apache Software Foundation. Attackers are actively exploiting it in the wild (listed by CISA on March 7, 2023). The chance it is exploited in the next 30 days is estimated at 93.2% (higher than 99.8% of all known vulnerabilities). Ready-made attack tooling exists: Metasploit, Nuclei, public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.8High
Exploit odds (30 days)93.2%top 0.2% of all CVEs
Exploited in the wildYesCISA KEV since Mar 7, 2023
Attack tooling3Metasploit, Nuclei, Public PoC

CISA guidance

Apply updates per vendor instructions.

Federal agencies must remediate by Mar 28, 2023.

Official description

The Apache Spark UI offers the possibility to enable ACLs via the configuration option spark.acls.enable. With an authentication filter, this checks whether a user has access permissions to view or modify the application. If ACLs are enabled, a code path in HttpSecurityFilter can allow someone to perform impersonation by providing an arbitrary user name. A malicious user might then be able to reach a permission check function that will ultimately build a Unix shell command based on their input, and execute it. This will result in arbitrary shell command execution as the user Spark is currently running as. This affects Apache Spark versions 3.0.3 and earlier, versions 3.1.1 to 3.1.2, and versions 3.2.0 to 3.2.1.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Mavenorg.apache.spark:spark-parent_2.12no fix listedGHSA-4x9r-j582-cgr8
Mavenorg.apache.spark:spark-parent_2.123.2.2GHSA-4x9r-j582-cgr8
PyPIpyspark3.1.3GHSA-4x9r-j582-cgr8
PyPIpyspark3.2.2GHSA-4x9r-j582-cgr8
PyPIpyspark3.1.3, 3.2.2PYSEC-2022-236

Affected products (as reported)

VendorProductVersions
Apache Software Foundation Apache Spark 3.0.3 and earlier – through 3.0.33.1.1 to 3.1.2 – through 3.1.23.2.0 to 3.2.1 – through 3.2.1

Weakness: CWE-78 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References