GHSA-PVJX-V7VP-62VQ
Netty: [HttpServerCodec] Unbounded Per-Connection Queue Growth via HTTP/1.1 Pipelining
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 4.2.18.Final | io.netty:netty-codec-http · -1 d desde divulgación | |
| Divulgación | Publicada | GHSA-PVJX-V7VP-62VQ divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
HttpServerCodec tracks, per connection, which HTTP method each still-unanswered pipelined request used. The first 32 pending entries are bit-packed into a single long, but every entry beyond that spills into `methodOverflowQueue`, a plain `ArrayDeque<Byte>` with no upper bound at all. A remote, unauthenticated attacker who pipelines requests on one connection while withholding reads on their own end can grow this queue without limit, causing unbounded heap growth. This is the exact same defect class fixed weeks ago in the sibling class HttpContentEncoder (CVE-2026-59899) — HttpServerCodec, a far more foundational and universally-used class, never received the equivalent fix.
### Details
`enqueueMethod()` (`codec-http/src/main/java/io/netty/handler/codec/http/HttpServerCodec.java`, lines 184-209; `methodOverflowQueue` field at line 73; `INLINE_QUEUE_CAPACITY = 32` at line 60):
private void enqueueMethod(HttpMethod method) {
final byte flag = ...;
Queue<Byte> overflowQueue = methodOverflowQueue;
if (overflowQueue != null) {
overflowQueue.add(flag); // unconditional, no size check
return;
}
if (methodQueueSize < INLINE_QUEUE_CAPACITY) {
methodQueue |= (long) flag << (methodQueueSize << 1);
methodQueueSize++;
} else {
overflowQueue = new ArrayDeque<>(4);
overflowQueue.add(flag); // unconditional, no size check
methodOverflowQueue = overflowQueue;
}
}
Called unconditionally from the nested decoder override for every decoded request (lines 237-248):
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> out) throws Exception {
int oldSize = out.size();
super.decode(ctx, buffer, out);
...
for (int i = oldSize; i < size; i++) {
Object obj = out.get(i);
if (obj instanceof HttpRequest) {
enqueueMethod(((HttpRequest) obj).method());
}
}
}
There is no `maxPipelineDepth`, no max queue size, no rejection path anywhere in this class — confirmed by reading the entire file and grepping for `maxPipeline|MAX_PIPELINE`. This is precisely the pattern CVE-2026-59899 fixed in `HttpContentEncoder`, whose `decode()` now enforces:
if (maxPipelineDepth <= acceptEncodingQueue.size()) {
throw new IllegalStateException("maxPipelineDepth exceeded: " + maxPipelineDepth);
}
(default cap `DEFAULT_MAX_PIPELINE_DEPTH = 128`, unit-tested by `HttpContentEncoderTest#testPipelineDepthLimited`). `HttpServerCodec` never got the analogous treatment, despite being the request-decoder/response-encoder pair that essentially every Netty-based HTTP/1.1 server uses directly — with or without `HttpContentEncoder`/`HttpContentCompressor` ever being present in the pipeline.
Related observation (same pattern, not independently deep-verified): the client-side sibling `HttpClientCodec` has a structurally identical unbounded `private final Queue<HttpMethod> queue = new ArrayDeque<HttpMethod>()` with an unchecked `queue.offer(...)` — worth checking as part of the same fix, since it suggests the gap is systemic across the pipelining-aware codec family rather than isolated to one class.
### PoC
A remote, unauthenticated attacker opens a single TCP connection to any Netty HTTP/1.1 server built on `HttpServerCodec`, pipelines a large number of minimal requests back-to-back (`GET / HTTP/1.1\r\nHost: x\r\n\r\n`, repeated), and never reads from their own end of the socket. Netty's default `autoRead` keeps invoking the decoder on any bytes present in the socket receive buffer regardless of outbound backpressure (`WriteBufferWaterMark` throttles writes but does not disable `autoRead` unless the application explicitly wires `channelWritabilityChanged` to `setAutoRead(false)` — opt-in, not default). Each decoded request immediately calls `enqueueMethod()`; because the attacker withholds reads, responses cannot be flushed, so decoding runs far ahead of responding — the first 32 entries fill the inline bit-packed long, and every request after that appends an unbounded entry to `methodOverflowQueue`.
Verified three ways:
1. Isolated reproduction of `enqueueMethod`/`pollMethod` alone: 50,000,000 unconditional enqueue calls, zero exceptions, overflow queue landed at exactly 49,999,968 entries, heap grew ~272MB in lockstep — fully attacker-input-proportional.
2. Full end-to-end reproduction against the real, unmodified, current-HEAD compiled `HttpServerCodec` class, driven through a genuine HTTP/1.1 byte-level decode pipeline via `EmbeddedChannel`: fed 500,000 pipelined minimal `GET` requests in 100 chunks of 5,000 (simulating separate reads over a connection's life) while never writing any outbound response. Result: inline queue filled to exactly 32, `methodOverflowQueue` (inspected via reflection) grew to exactly 499,968, zero exceptions or caps at any checkpoint, ~300ms in-process.
3. Confirmed the decode/dispatch interleaving nuance (a purely synchronous zero-latency echo handler could in principle keep the queue near-empty) doesn't reduce real-world risk — the same mechanic applies identically to the already-fixed sibling `HttpContentEncoder`, and Netty's own security team still fixed and CVE'd that at 7.5 HIGH. Any handler with async dispatch, thread-pool hand-off, backend calls, or ordinary non-zero processing latency — i.e. virtually all real servers — lets decode race ahead of respond.
### Impact
Sustained over one long-lived connection, or trivially multiplied across many concurrently opened connections (which costs the attacker only sockets, not compute), this drives unbounded heap growth purely from Netty's own internal per-connection bookkeeping — a memory-exhaustion denial of service, the identical impact category already classified as CVE-worthy for `HttpContentEncoder` weeks earlier, reached here through a different, unpatched, and more foundational sibling codec.
Suggested fix: add the same `maxPipelineDepth`-style bound (reject/throw once a configurable cap is exceeded) already used in `HttpContentEncoder` to `HttpServerCodec`'s `methodOverflowQueue`, and consider the same fix for `HttpClientCodec`'s analogous unbounded queue.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
mavenio.netty:netty-codec-http |
Corregida | 4.2.18.Final | -1 d | 4.2.21.Final no afectada |
4.2.18.FinalArsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/netty/netty/security/advisories/GHSA-pvjx-v7vp-62vqLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
