CVE-2022-33891: Apache Spark Command Injection Vulnerability
Apache Spark contains a command injection vulnerability via Spark User Interface (UI) when Access Control Lists (ACLs) are enabled.
Other sources
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.
A previous version of this advisory incorrectly stated that version 3.1.3 was not vulnerable. Per GHSA-59hw-j9g6-mfg3, version 3.1.3 is vulnerable and vulnerable version ranges in this advisory have been changed to reflect the correct information.
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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/pysparkto a version that resolves this vulnerability.Fixed in 3.2.2 - Upgrade
Upgrade
maven/org.apache.spark:spark-parent_2.12to a version that resolves this vulnerability.Fixed in 3.2.2 - Upgrade
Upgrade
Apache Sparkto a version that resolves this vulnerability.Fixed in 3.2.2 - Configuration
Disable ACLs by setting spark.acls.enable to false to avoid the vulnerable UI code path that can lead to command injection when ACLs are enabled.
Apache Spark spark.acls.enable = false
Event History
Frequently Asked Questions
What is CVE-2022-33891?
CVE-2022-33891 is a vulnerability in Apache Spark that allows command injection.
What is the severity of CVE-2022-33891?
CVE-2022-33891 has a severity rating of 8.8 (High).
How does CVE-2022-33891 affect Apache Spark?
CVE-2022-33891 affects Apache Spark versions 3.0.3 to 3.2.1, as well as pyspark and spark-parent_2.12 packages versions between 3.1.1 and 3.2.2.
How can I fix CVE-2022-33891?
To fix CVE-2022-33891, you should upgrade to Apache Spark version 3.2.2 or higher.
Where can I find more information about CVE-2022-33891?
You can find more information about CVE-2022-33891 at the following references: [1] http://packetstormsecurity.com/files/168309/Apache-Spark-Unauthenticated-Command-Injection.html [2] http://www.openwall.com/lists/oss-security/2023/05/02/1 [3] https://lists.apache.org/thread/p847l3kopoo5bjtmxrcwk21xp6tjxqlc