Patchfirst
CVE-2022-33891 KEVPublic exploit High · 8.8 EPSS 93.2%

Apache Spark Command Injection Vulnerability

Apache · Spark

Summary

The Apache Spark web UI's access control checks, enabled through the spark.acls.enable option, contain a command injection flaw in the HttpSecurityFilter impersonation path and its permission check function. An attacker with low-privilege access who can reach the Spark UI can supply an arbitrary user name to impersonate another user, which causes the permission check to build a Unix shell command from that input and execute it as the user running Spark, without user interaction.

Official description · NVD

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.

Breakdown
73.0 / 100
Exploited
Yes, in CISA KEV
Reports
1
Tactics
2/15

How an attack unfolds

Based on mappings. Select a step to see the evidence.
  1. How attackers get in

  2. What they do

First seen exploited 5 months after disclosure. Public exploit code (PoC-in-GitHub) was available the same day.

  1. DisclosedPublic exploit codePoC-in-GitHubday 0
  2. First seen exploitedVulnCheck KEV evidence+5 mo
  3. Added to CISA KEVEU database agrees+8 mo

CISA KEV listing is when exploitation was confirmed, not necessarily the first attack.

See the family tree

2 related vulnerabilities in the same code over 9 months.

Same bug familyLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. This CVECVE-2022-33891Spark Command Injection18 Jul 2022KEV
  2. relatedHigh

    Why these are linked:

    CVE-2023-32007Spark: Shell command injection via Spark UI2 May 2023

techniques

2 , grouped by in kill-chain order, 5 cited passages 2

Initial AccessTA0001

Exploit Public-Facing Application T1190 Medium
AI mapping from the description · how it is exploited

Exploit via the publicly reachable Spark web UI; TRAM2 annotated sentence label

With an authentication filter, this checks whether a user has access permissions to view or modify the application
From the official description (NVD) Original (opens in a new tab) ↗
The most recent distribution of Zerobot includes additional capabilities, such as exploiting vulnerabilities in Apache and Apache Spark (CVE-2021-42013 and CVE-2022-33891 respectively), and new DDoS attack capabilities.
Microsoft research uncovers new Zerobot capabilities microsoft.com Original (opens in a new tab) ↗
softwareCVE-2017-17105Zivif PR115-204-P-RSCVE-2019-10655GrandstreamCVE-2020-25223WebAdmin of Sophos SG UTMCVE-2021-42013ApacheCVE-2022-31137Roxy-WICVE-2022-33891Apache SparkZSL-2022-5717MiniDVBLinuxSince the release of Zerobot 1.1, the malware operators have removed CVE-2018-12613, a phpMyAdmin vulnerability that could allow threat actors to view or execute files.
Microsoft research uncovers new Zerobot capabilities microsoft.com Original (opens in a new tab) ↗

ExecutionTA0002

Unix Shell T1059.004 Medium
AI mapping from the description · primary impact

Arbitrary Unix shell command execution as Spark user

will ultimately build a Unix shell command based on their input, and execute it
From the official description (NVD) Original (opens in a new tab) ↗

Detection

2 rules for this CVE · 168 general rules for its techniques

Rules for this CVE

2 that reference CVE-2022-33891 directly.

Sigma rules © SigmaHQ, Detection Rule License 1.1; linked, not reproduced.

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

2 packages in 2 ecosystems. Main package: org.apache.spark:spark-parent_2.12.

Mavenorg.apache.spark:spark-parent_2.12GHSA-4x9r-j582-cgr8

Upgrade to 3.2.2 or later

Fixes this CVE and 1 other known vulnerability in this package (CVE-2023-32007).

Set the version to 3.2.2 or later in your pom.xml or build.gradle.

The first fix for CVE-2022-33891.

Affected versions, by release line

If you runUpgrade to
3.1.1 up to 3.2.23.2.2
3.0.3 and earlierNo fix published

“Up to” means the second version is the fix and is not affected.

Other packages that bundle this code (1)

Forks, repackagings and products that include the affected code. Each has its own fixed version.

  • PyPIpyspark
    Affected: 3.2.0 up to 3.2.2; All versions before 3.1.3Upgrade to 3.2.2 or later (older lines: 3.1.3)

Check your lockfile against all CVEs

What security researchers reported

Named in 1 threat report
1 reportMicrosoft

Reports are matched by finding the exact id CVE-2022-33891 in their text; nobody has reviewed the match. One passage is shown per report, at most 320 characters, linked to the original.

MicrosoftUndated

Microsoft research uncovers new Zerobot capabilities

…softwareCVE-2017-17105Zivif PR115-204-P-RSCVE-2019-10655GrandstreamCVE-2020-25223WebAdmin of Sophos SG UTMCVE-2021-42013ApacheCVE-2022-31137Roxy-WICVE-2022-33891Apache SparkZSL-2022-5717MiniDVBLinuxSince the release of Zerobot 1.1, the malware operators have removed CVE-2018-12613, a phpMyAdmin vulnerability…

3 passages name itOriginal (opens in a new tab) ↗

Also mentioned in 50 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

4 links, grouped by NVD tag (3 duplicates merged)
↑ ↓ chooseEnter openEsc close