Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2022-33891: Apache Spark UI impersonation and shell command injection

Published Jul 18, 2022 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS8.8High · v3.1
EPSS92.9%100th percentile
CISA KEVYesAdded Mar 7, 2023
In the wildActivePer CISA KEV
Vendor
Apache Software Foundation
IdentifiersCVE-2022-33891CWE-78 · Improper Neutralization of Special…

CVE-2022-33891 is a command injection vulnerability in Apache Spark UI. When ACLs are enabled, an impersonation flaw in HttpSecurityFilter allows an attacker to supply an arbitrary username and reach a permission-check function that constructs and executes a Unix shell command using attacker-controlled input. Successful exploitation executes arbitrary shell commands under the Spark process account. Affected releases include Apache Spark 3.0.3 and earlier, 3.1.1–3.1.2, and 3.2.0–3.2.1.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

An attacker can impersonate an arbitrary user and execute shell commands with the privileges of the account running Spark. The resulting compromise is bounded by that account's permissions. Zerobot variants have incorporated exploitation of this vulnerability into their propagation capabilities.

Mitigation

If you can’t patch tonight, do this now.

Until upgrading, disable or avoid enabling Spark UI ACLs through spark.acls.enable, while restricting UI access through appropriate authentication and network controls. Do not rely on disabling ACLs alone as an access-control measure.

Remediation

Patch, then assume compromise.

Upgrade Apache Spark and associated PySpark installations to a fixed release: 3.1.3 for the affected 3.1.x branch or 3.2.2 for the affected 3.2.x branch, or move to a newer supported release. Upgrade affected older installations rather than remaining on vulnerable 3.0.x releases.

Public exploits

Exploits

6 exploits validated by Mallory's analysis.

View more in app →
apache_spark_rce_cve_2022_33891.rbThis repository contains a single Metasploit module targeting CVE-2022-33891, an unauthenticated command injection vulnerability in Apache Spark. The exploit leverages improper handling of the 'doAs' parameter when the 'spark.acls.enable' configuration is set to true, allowing remote attackers to execute arbitrary commands as the Spark application user. The module supports both in-memory command execution (using a Python reverse shell) and a dropper mode (deploying a Meterpreter reverse TCP shell), making it highly weaponized and flexible. The attack is performed over HTTP (default port 8080), and the exploit is effective against Apache Spark versions 3.0.3 and earlier, 3.1.1 to 3.1.2, and 3.2.0 to 3.2.1. The repository is structured as a single Ruby file compatible with the Metasploit framework, and it provides both detection and exploitation capabilities, including automated payload delivery and session management.Disclosed Jul 18, 2022 · Framework: metasploit · ruby · networkWeaponizedCVE-2022-33891-EXPLOITThis repository contains a Python-based exploit for CVE-2022-33891, a remote code execution vulnerability in Apache Spark UI when Access Control Lists (ACLs) are enabled. The main file, 'CVE-2022-33891.py', provides both exploitation and scanning capabilities. It allows the user to test a single target or scan multiple targets for vulnerability. If a target is found to be vulnerable, the script can deploy a payload that opens either a reverse shell (connecting back to the attacker's machine) or a bind shell (listening on the target). The exploit works by sending a specially crafted HTTP POST request to the Spark UI endpoint, injecting a base64-encoded bash command that establishes the shell. The script includes interactive shell handling and multi-threaded scanning. The README.md provides background on the vulnerability, affected versions, and ethical usage guidelines. The exploit is operational, providing a working shell if the target is vulnerable and properly configured.K3ysTr0K3R · Disclosed Feb 22, 2024 · python · networkOperationalCVE-2022-33891This repository provides a working proof-of-concept (PoC) exploit for CVE-2022-33891, a command injection vulnerability in Apache Spark's UI when ACLs are enabled. The exploit is implemented in Python (poc.py) and allows an attacker to execute arbitrary shell commands on a vulnerable Spark server by abusing the 'doAs' parameter in HTTP requests. The exploit supports three modes: a vulnerability check (using a sleep test), an interactive command execution mode (blind, no output), and a reverse shell mode that connects back to an attacker-controlled host. The repository includes a docker-compose.yml file to set up a vulnerable Spark instance for testing, and a requirements.txt for Python dependencies. The main attack vector is network-based, targeting the Spark UI HTTP interface (default port 8080). The exploit is operational, providing real command execution and reverse shell capabilities, but does not include advanced features such as output retrieval or payload customization beyond the reverse shell. The repository is well-structured for both demonstration and testing of the vulnerability.asepsaepdin · Disclosed Jan 30, 2025 · python · yaml · networkOperationalcve-2022-33891This repository provides a Python proof-of-concept exploit for CVE-2022-33891, a command injection vulnerability in Apache Spark. The exploit targets the Spark web interface by sending a GET request with a crafted 'doAs' parameter that injects a shell command (ping to an attacker-controlled domain). The script uses dnslog.cn to obtain a unique domain and verify if the target system performs the DNS lookup, indicating successful command execution. The repository consists of a README with usage instructions and a single Python script (cve_2022_33891_poc.py) that supports both single and batch URL testing. Detected vulnerable URLs are saved to a local file. The exploit is a POC and does not provide a weaponized or post-exploitation payload.W01fh4cker · Disclosed Jul 18, 2022 · python · networkPoCcve-2022-33891This repository provides a Python proof-of-concept (POC) exploit for CVE-2022-33891, a command injection vulnerability in Apache Spark's web UI. The main exploit script is 'poc.py', which allows an attacker to execute arbitrary shell commands on a vulnerable Spark instance by injecting commands into the 'doAs' parameter of HTTP requests to the Spark web interface (typically on port 8080). The exploit supports three main modes: a vulnerability check using a 'sleep' command, an interactive command injection mode, and a reverse shell mode that connects back to an attacker-controlled host. The repository includes a 'requirements.txt' for dependencies and a 'spark/docker-compose.yml' file to help set up a vulnerable Spark environment for testing. The exploit is blind (no output is returned to the attacker), so timing-based tests (like 'sleep') are used to confirm successful command execution. The README provides detailed usage instructions, affected versions, and setup guidance. The exploit targets Apache Spark versions 3.0.3 and earlier, 3.1.1 to 3.1.2, and 3.2.0 to 3.2.1, primarily on Linux platforms.HuskyHacks · Disclosed Jul 19, 2022 · python · yaml · networkPoCCVE-2022-33891This repository contains a Python proof-of-concept exploit for CVE-2022-33891, a command injection vulnerability in Apache Spark's web UI. The exploit script (CVE-2022.33891.py) allows a user to test a single URL or a list of URLs for vulnerability by sending HTTP GET requests with a crafted 'doAs' parameter containing a shell command (e.g., `sleep 7`). The script measures the response time to infer if the command was executed, indicating vulnerability. The README provides background on the vulnerability, affected versions, usage instructions, and references. The exploit targets Apache Spark instances accessible over HTTP and is effective against specific vulnerable versions with ACLs enabled. No hardcoded endpoints are present; the user supplies target URLs. The repository is structured simply, with one exploit script and a README.AmoloHT · Disclosed Jul 30, 2022 · python · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Apache Software FoundationSparkapplication
FAQ

Frequently asked questions

Is CVE-2022-33891 exploited in the wild?
Yes. As of Oct 16, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Mar 7, 2023.
Is there a public exploit for CVE-2022-33891?
Yes. Mallory tracks 6 public exploits or proofs of concept for CVE-2022-33891, the earliest disclosed Jul 18, 2022.
Is there a patch for CVE-2022-33891?
Upgrade Apache Spark and associated PySpark installations to a fixed release: 3.1.3 for the affected 3.1.x branch or 3.2.2 for the affected 3.2.x branch, or move to a newer supported release. Upgrade affected older installations rather than remaining on vulnerable 3.0.x releases.
What products are affected by CVE-2022-33891?
Apache Software Foundation Spark.
How severe is CVE-2022-33891?
CVE-2022-33891 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 92.9% (100th percentile) as of Oct 16, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence3Every report linking this CVE to a named adversary.
Associated malware4Malware families linked to this CVE, with evidence and IOCs.
Detection signatures2YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.