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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Maven | org.apache.spark:spark-parent_2.12 | no fix listed | GHSA-4x9r-j582-cgr8 |
| Maven | org.apache.spark:spark-parent_2.12 | 3.2.2 | GHSA-4x9r-j582-cgr8 |
| PyPI | pyspark | 3.1.3 | GHSA-4x9r-j582-cgr8 |
| PyPI | pyspark | 3.2.2 | GHSA-4x9r-j582-cgr8 |
| PyPI | pyspark | 3.1.3, 3.2.2 | PYSEC-2022-236 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://lists.apache.org/thread/p847l3kopoo5bjtmxrcwk21xp6tjxqlc
- http://packetstormsecurity.com/files/168309/Apache-Spark-Unauthenticated-Command-Injection.html
- [oss-security] 20230502 CVE-2023-32007: Apache Spark: Shell command injection via Spark UI mailing-list
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-33891 government-resource