Actively exploited vulnerability
Apache Spark: code execution flaw under attack
CVE-2022-33891 · Apache Spark Command Injection Vulnerability
What is affected
Apache Spark is mostly run by companies, schools and public bodies, not on home computers. You are unlikely to have it yourself, but organisations that hold your data may. Breaches that start with flaws like this one are how personal data ends up leaked.
Apache Spark contains a command injection vulnerability via Spark User Interface (UI) when Access Control Lists (ACLs) are enabled.
What an attacker can do
This is a code execution flaw. It lets an attacker run their own commands or programs on the affected system. In practice that usually means taking it over: installing malware, stealing data or using it to reach other devices on the same network.
- How it is reached
- Over the internet or network
- Access the attacker needs
- A basic user account
- Does the victim have to do something?
- No, works without the victim doing anything
What to do
- At home: nothing to install. Keep your own devices updated and use a different password for every service, so that a breach at one organisation does not open your other accounts.
- If you administer Apache Spark at work: apply the vendor's fix or mitigation now and review logs for signs of compromise, because the flaw was being exploited before it was listed.
- If the product is past its support date and no fix exists, take it off the internet or retire it.
Apply updates per vendor instructions.
Vendor advisories and fixes
- lists.apache.orglists.apache.org/thread/p847l3kopoo5bjtmxrcwk21xp6tjxqlc
How urgent is it
CISA added this vulnerability to its Known Exploited Vulnerabilities catalogue on March 7, 2023, which means there is reliable evidence of attacks in the wild. US federal agencies must fix it by March 28, 2023, a deadline that has already passed. That deadline does not bind anyone else, but it shows how seriously the agency rates it.
The EPSS model estimates a 93% probability that this flaw will be exploited somewhere in the next 30 days. That is higher than 99.8% of all scored vulnerabilities.
Its CVSS severity score is 8.8 out of 10 (high), as recorded in the US National Vulnerability Database.
Technical 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.