CVE-2022-33891: Apache Spark Command Injection Vulnerability

Published Jul 18, 2022
·
Updated

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

8 affected componentsFixes available
Apache Spark<=3.0.3
Apache Spark>=3.1.1<=3.1.2
Apache Spark>=3.2.0<=3.2.1
Apache Spark
pip/pyspark>=3.1.1<3.2.2
3.2.2
maven/org.apache.spark:spark-parent_2.12>=3.1.1<3.2.2
3.2.2
maven/org.apache.spark:spark-parent_2.12<=3.0.3
pip/pyspark>=0<=3.0.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pyspark to a version that resolves this vulnerability.

    Fixed in 3.2.2
  2. Upgrade

    Upgrade maven/org.apache.spark:spark-parent_2.12 to a version that resolves this vulnerability.

    Fixed in 3.2.2
  3. Upgrade

    Upgrade Apache Spark to a version that resolves this vulnerability.

    Fixed in 3.2.2
  4. 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

Jul 18, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via NVD·07:15 AM
DescriptionSeverityWeaknessAffected Software
Jul 19, 2022
Advisory Published
via GitHub·12:00 AM
Data Sourced
via GitHub·12:00 AM
DescriptionSeverityWeaknessAffected Software
Mar 7, 2023
Known Exploited
via CISA·12:00 AM
Jul 13, 2024
News Published
via BleepingComputer·03:16 PM
Jul 14, 2024
News Published
via BleepingComputer·03:33 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-33891?

CVE-2022-33891 is a vulnerability in Apache Spark that allows command injection.

2

What is the severity of CVE-2022-33891?

CVE-2022-33891 has a severity rating of 8.8 (High).

3

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.

4

How can I fix CVE-2022-33891?

To fix CVE-2022-33891, you should upgrade to Apache Spark version 3.2.2 or higher.

5

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

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203