
Apache Spark 4.2.0 - Alto - Remoto - Privilegio residuo - REST standalone ignora spark.authenticate
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · spark-rest-auth-bypass
Classe: Privilegio residuo Portata: Remota
Apache Spark 4.2.0 (32f72996) - Apache Software Foundation
Il Master REST standalone è attivo di default sulla porta 6066 e non legge mai spark.authenticate. CVE-2018-11770 aveva promesso REST disattivato di default e un fail-closed se il segreto RPC era impostato mentre REST era attivo. Questa versione ha invertito entrambe le cose. MASTER_REST_SERVER_ENABLED è createWithDefault(true). I filtri sono solo MASTER_REST_SERVER_FILTERS, default Nil. Un POST /v1/submissions/create non autenticato esegue il main dell'attaccante con l'UID del Worker. Il Worker inietta _SPARK_AUTH_SECRET, quindi il limite del 2018 "driver senza executor" non regge.
Questo è un residuo di 11770, non un nuovo RCE CVE-2020-9480. RPC 7077 installa ancora AuthServerBootstrap. Il job submit su un cluster con spark.authenticate=false è il default documentato e non è questo bug.
| ID | nessuna CVE al momento |
| Classe | Privilegio residuo (residuo di CVE-2018-11770) |
| Portata | Remota (HTTP non autenticato verso il Master standalone 6066) |
| CWE | CWE-306, CWE-287 |
| CVSS | Alto: 8.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Prodotto | Apache Spark |
| Affetto | 4.2.0 (32f7299601108917fb01920a54e084595b7b3bf8) Master REST standalone |
| Auth | nessuna su REST. L'operatore ha impostato spark.authenticate=true. REST lasciato al default. |
| Licenza | GNU Affero GPL v3.0 |
| Lab | solo 127.0.0.1:18900. Immagine ufficiale spark:4.2.0. |
Ho fissato il tag v4.2.0, peel 32f7299601108917fb01920a54e084595b7b3bf8 (2026-07-11, v4.2.0-rc6). Non master. Non una RC 4.3.
Raggiungere il Master REST standalone su 6066. Nessun header Authorization. spark.authenticate è attivo. spark.master.rest.filters non è impostato. Almeno un Worker è attivo.
| Metodo | Sink | Privilegio |
|---|---|---|
POST /v1/submissions/create non autenticato | RequestSubmitDriver (Master.scala:402-420) poi Worker DriverWrapper classForName(mainClass).main | Integrità (provata in lab): esegue il mainClass dell'attaccante con l'UID del Worker. Lab: driver RUNNING, file witness. |
Stesso create; Worker CommandUtils.buildLocalCommand | env del driver _SPARK_AUTH_SECRET | Integrità (provata in lab): il driver può unirsi via SASL al cluster RPC autenticato. Lab: injected=yes. |
GET /v1/submissions/status/{id} non autenticato | RequestDriverStatus (Master.scala:489-503) | Recon (provata in lab per l'id creato): stato del driver / host del worker. |
GET /v1/submissions/readyz non autenticato | RequestReadyz | Recon (provata in lab): Master non in STANDBY. |
POST /v1/submissions/kill/{id} non autenticato | RequestKillDriver (Master.scala:422-453) | Integrità + disponibilità (inferita): fermare il driver standalone di un altro tenant. Stesso wiring del servlet non autenticato; non esercitata. |
POST /v1/submissions/killall non autenticato | RequestKillAllDrivers (Master.scala:455-478) | Disponibilità (inferita): terminare ogni driver standalone in attesa/in esecuzione. Non esercitata. |
POST /v1/submissions/clear non autenticato | RequestClearCompletedDriversAndApps | Integrità (inferita): eliminare la contabilità dei driver/app completati. Non esercitata. |
Provato in lab vs inferito: create, iniezione del segreto, status del proprio id e readyz sono da lab. Kill / killall / clear sono inferiti dalla stessa mappa di servlet non autenticati.
Richiede: Master standalone (non YARN/K8s). L'operatore ha impostato spark.authenticate=true. REST lasciato al default (spark.master.rest.enabled true, spark.master.rest.filters non impostato). Percorso di rete verso il Master 6066. Almeno un Worker. Non il cluster documentato come aperto (spark.authenticate=false).
| Superficie | Perché |
|---|---|
RPC 7077 con spark.authenticate=true | AuthServerBootstrap ancora richiesto. Il percorso di ricezione di CVE-2020-9480 resta chiuso. Non è un nuovo RCE 9480. |
| JWSFilter quando impostato | spark.master.rest.filters=org.apache.spark.ui.JWSFilter più secretKey. I test restituiscono 403 senza JWT. Opt-in. Default Nil. |
UI doAs | richiede ancora admin. REST non eredita i filtri della UI. |
| Shell UI CVE-2022-33891 | residuo argv id -Gn chiuso su questa versione. |
| Submit YARN / Kubernetes | questo server REST è solo per il Master standalone. |
Job submit con default spark.authenticate=false | FAQ: by design. Non è questo residuo. |
| Mesos REST | rimosso in Spark 4.0. |
Default CLI spark-submit | usa ancora RPC 7077 (useRest ha default stringa false). --kill / --status su spark:// usano sempre REST. Il residuo è il listener del server. |
La correzione al codice di CVE-2018-11770 (SPARK-25088) era: REST disattivato di default, e require sul Master fail-closed se spark.authenticate.secret è impostato mentre REST è attivo. Questa versione: