GHSA-2355-646M-8M98
Unauthenticated webhook multipart requests exhaust Kestra webserver memory
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 2.0.9 | io.kestra:kestra · -9 d desde divulgación | |
| Divulgación | Publicada | GHSA-2355-646M-8M98 divulgada · CVSS 7.5 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Kestra's anonymous webhook routes (`POST`/`PUT`, bound as `@Body MultipartBody`) check the webhook key before subscribing to the request body. On a wrong key or a non-existent flow the route returns 404, but the multipart body already claimed by the Micronaut binder is never consumed or released, so the received bytes stay in Netty off-heap (direct) memory. Repeated unauthenticated requests exhaust the direct-memory pool and take the webserver down. No credentials, webhook key, or pre-existing webhook flow are required. The vulnerable handler was introduced in 2.0.0 and remains in 2.0.8 (latest); runtime-confirmed on 2.0.7 and 2.0.8.
Details
Anchors are identical in v2.0.7 (commit `49b62a2`) and v2.0.8 (commit `cfd8842`).
The POST and PUT multipart handlers are `@AnonymousAccess` and bind `@Body MultipartBody` (`webserver/src/main/java/io/kestra/webserver/controllers/api/ExecutionController.java:608-619,625-637`). Both reach `webhookMultipart()`, which calls `resolveWebhook(maybeFlow, key)` at `:708` before `WebhookBodyService.collect()` at `:714`:
Flow flow = resolveWebhook(maybeFlow, key).flow(); // :708 — throws 404 on wrong key / missing flow
...
.collect(parts, flow, executionId, ...) // :714 — only here is the body subscribedA wrong key, or a missing flow via `findFlowForWebhook()`, throws at `:708` and returns 404 before `collect()` subscribes to the `parts` publisher (`WebhookBodyService.java:103-125`). Micronaut's `MultipartBodyArgumentBinder` has already claimed the streaming body and received the bytes the client sent; because `collect()` never runs, nothing subscribes to or discards it, and those bytes remain in Netty direct memory. Default limits allow 10 GB requests and files (`cli/src/main/resources/application.yml:23-25`), so the leak does not depend on body size.
Under load the webserver logs, from `RoutingInBoundHandler`:
io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 131072 byte(s) of direct memory
(used: 2147418398, max: 2147483648)
at io.netty.util.internal.PlatformDependent.allocateDirectThe direct pool (`max` 2 GiB = `-XX:MaxRAMPercentage=50` of a 4 GiB container) is full, so no buffer can be allocated for a new connection. While the server is wedged the G1 heap holds only ~0.5 GiB of 2 GiB reserved, confirming the retained memory is off-heap, not heap.
Proof of concept
Send repeated anonymous multipart POSTs with a wrong key, each carrying a ~128 KiB file part and no `Authorization` header:
POST /api/v1/main/executions/webhook/{namespace}/{flow}/{wrong-key}head -c 131072 /dev/zero > part.bin
seq 20000 | xargs -P128 -I_ curl -s -o /dev/null \
-F 'file=@part.bin' \
http://127.0.0.1:8080/api/v1/main/executions/webhook/any-ns/any-flow/wrong-keyAgainst a 4 GiB container (Kestra's documented standalone minimum):
- Each request returns 404 and retains ~110–122 KiB; ~17,000 requests (~2.1 GiB total upload) fill the 2 GiB direct pool.
- Outcome is timing-dependent and both forms were observed on v2.0.8: the webserver either refuses all requests while the process stays alive (`running=true`, manual restart required) or is OOM-killed (`exit 137`, `OOMKilled=true`, as on v2.0.7).
- During the outage, independent authenticated requests to `/api/v1/configs` fail (`HTTP 000`); after a wedge they keep failing until restart.
- Control: the same request count with an empty body grows memory by ~190 MiB and the server stays healthy, isolating the leak to the retained multipart body.
- A non-existent flow id produces the same 404 and the same OOM kill, so the target need not have any webhook configured.
Impact
An unauthenticated caller who can reach the webserver can make it stop serving: either a persistent non-responsive state (the process stays alive, so liveness and restart policies do not fire and an operator must restart it) or an OOM kill. No webhook execution or storage write occurs. There is no confidentiality or integrity impact — the retained buffers hold only the attacker's own bytes.
Upstream advisories
See the following related advisories from Micronaut:
- GHSA-8rrh-x2ch-p2vv https://github.com/micronaut-projects/micronaut-core/security/advisories/GHSA-8rrh-x2ch-p2vv
- GHSA-2cp9-fx7w-pxph https://github.com/micronaut-projects/micronaut-core/security/advisories/GHSA-2cp9-fx7w-pxph
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
mavenio.kestra:kestra |
Corregida | 2.0.9 | -9 d | 2.0.10 no afectada |
2.0.9Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/kestra-io/kestra/security/advisories/GHSA-2355-646m-8m98Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
