CVE-2022-33891
JSON

8.8highExploited

Apache Spark shell command injection vulnerability via Spark UI

Severity
8.8high CVSS:3.1 by CISA-ADP
Exploit likelihood
92.9% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
apache
Also known as
GHSA-4x9r-j582-cgr8BIT-SPARK-2022-33891PYSEC-2022-236

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

Product or packageVersionsReported by
Apache Software Foundation Apache Sparkfrom 3.0.3 and earlier up to 3.0.3, from 3.1.1 to 3.1.2 up to 3.1.2, from 3.2.0 to 3.2.1 up to 3.2.1CVE List
org.apache.spark:spark-parent_2.12 (Maven)up to 3.0.3, from 3.1.1 before 3.2.2GitHub Advisory Database
pyspark (PyPI)before 3.1.3, from 3.2.0 before 3.2.2GitHub Advisory Database, PyPA Advisory Database
apache sparkup to 3.0.3, from 3.1.1 up to 3.1.2, from 3.2.0 up to 3.2.1NVD, CISA KEV
spark (Bitnami)before 3.0.4, from 3.1.1 before 3.1.3, from 3.2.0 before 3.2.2Bitnami Vulnerability Database

All scores

CISA-ADP8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHub8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N/E:A
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasehigh rating

Classification

CWE-78

SSVC (CISA-ADP): exploitation active, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

La interfaz de usuario de Apache Spark ofrece la posibilidad de habilitar ACLs por medio de la opción de configuración spark.acls.enable. Con un filtro de autenticación, es comprobado si un usuario presenta permisos de acceso para ver o modificar la aplicación. Si las ACLs están habilitadas, una ruta de código en HttpSecurityFilter puede permitir que alguien lleve a cabo una suplantación de identidad proporcionando un nombre de usuario arbitrario. Un usuario malicioso podría entonces ser capaz de llegar a una función de comprobación de permisos que finalmente construirá un comando de shell Unix basado en su entrada, y lo ejecutará. Esto resultará en la ejecución de un comando shell arbitrario como el usuario con el que Spark se está ejecutando actualmente. Esto afecta a las versiones de Apache Spark 3.0.3 y anteriores, a las versiones 3.1.1 a 3.1.2 y a las versiones 3.2.0 a 3.2.1

CISA KEV

Apache Spark contains a command injection vulnerability via Spark User Interface (UI) when Access Control Lists (ACLs) are enabled.

References

https://lists.apache.org/thread/p847l3kopoo5bjtmxrcwk21xp6tjxqlcadvisory, kev, mailing-list, third-party-advisory, web
http://packetstormsecurity.com/files/168309/Apache-Spark-Unauthenticated-Command-Injection.htmladvisory, exploit, third-party-advisory, vdb-entry, web
http://www.openwall.com/lists/oss-security/2023/05/02/1advisory, mailing-list, third-party-advisory, web
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-33891advisory, government-resource, third-party-advisory, us-government-resource, web
https://nvd.nist.gov/vuln/detail/CVE-2022-33891advisory, kev, web
https://github.com/apache/sparkpackage
https://github.com/pypa/advisory-database/tree/main/vulns/pyspark/PYSEC-2022-236.yamlweb
https://packetstormsecurity.com/files/168309/Apache-Spark-Unauthenticated-Command-Injection.htmlweb
https://www.openwall.com/lists/oss-security/2023/05/02/1web
https://github.com/advisories/GHSA-4x9r-j582-cgr8advisory

Sources

SourceRecordLicence
CVE ListCVE-2022-33891 changed 2025-10-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-4x9r-j582-cgr8 changed 2026-06-09CC-BY-4.0
NVDCVE-2022-33891 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2022-236 changed 2026-06-08CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-SPARK-2022-33891 changed 2026-09-08Apache-2.0
CISA KEVCVE-2022-33891 changed 2023-03-07CC0-1.0