GHSA-x8v2-478q-2hvg: High severity maven/org.asynchttpclient:async-http-client vulnerability
Impact
With WebSocket compression enabled, the client inflates permessage-deflate messages with no limit on the decompressed size. It installed Netty's shared WebSocketClientCompressionHandler.INSTANCE, whose inflater is unbounded, and webSocketMaxFrameSize and webSocketMaxBufferSize only bound the compressed bytes, because the frame aggregator sits in front of the inflater.
A malicious or compromised WebSocket server, or anyone on the path of a ws:// connection, can therefore send a message of about 2 MiB that inflates to about 2 GiB, the most a Netty buffer can hold. The client then copies the inflated message again to hand it to the listener. That exhausts the heap of a typically sized JVM. Netty catches the resulting OutOfMemoryError and closes that connection, but while the buffer is live any other allocation in the process can fail too, and a server that keeps sending such messages, on one connection or several, keeps the client at heap exhaustion.
Who is Impacted
Only applications that enable WebSocket compression with setEnablewebSocketCompression(true), which is off by default, and connect to a WebSocket server that is untrusted, compromised, or reached over cleartext ws://.
Affected versions
3.x: up to and including 3.0.13 2.x: from 2.2.0, when WebSocket compression was added, up to and including 2.16.1
Patches
Fixed in 3.0.14. A new setting, webSocketMaxDecompressedFrameSize (setWebSocketMaxDecompressedFrameSize, or the org.asynchttpclient.webSocketMaxDecompressedFrameSize property), bounds how far a message may inflate, and a message that would go past it fails the connection. It defaults to 128000000 bytes, the same as webSocketMaxBufferSize, so a message is bounded alike whether or not it was compressed; a compressed message that inflates past that, which was accepted before, now fails the connection. With aggregateWebSocketFrameFragments turned off, the bound applies to each frame instead, and fragments are delivered one at a time. Set it lower if you enable compression and do not expect large messages. 0 disables the limit.
The 2.x line is end of life and will not receive a fix. Upgrade to 3.0.14.
Workarounds
Leave WebSocket compression disabled, which is the default.
Details
After the handshake the inbound pipeline is ws-decoder, ws-aggregator, PerMessageDeflateDecoder, ahc-ws: the aggregator, which enforces webSocketMaxBufferSize, sees each message before it is inflated. WebSocketClientCompressionHandler.INSTANCE is built with maxAllocation = 0, which Netty treats as unbounded, and Netty has deprecated it in favour of a constructor that takes a limit. RFC 6455 Section 10.4 asks an implementation to limit the size of a message after reassembly, and under RFC 7692 Section 6.2 the message delivered to the application is the decompressed payload.
This is a different path from the HTTP response decompression fixed under CVE-2026-85721, which never reached the WebSocket pipeline.
Attribution
AI-assisted tools were used to support discovery and analysis.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.asynchttpclient:async-http-clientto a version that resolves this vulnerability.Fixed in 3.0.14 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.0.14 - Configuration
Leave WebSocket compression disabled by keeping setEnablewebSocketCompression(false); compression is off by default.
WebSocket client enableWebSocketCompression = false - Configuration
If WebSocket compression is enabled, set webSocketMaxDecompressedFrameSize using setWebSocketMaxDecompressedFrameSize or the org.asynchttpclient.webSocketMaxDecompressedFrameSize property; use 128000000 bytes by default, or a lower value when large messages are not expected.
WebSocket client webSocketMaxDecompressedFrameSize = 128000000 bytes or lower
Event History
Frequently Asked Questions
Which deployments are exposed?
Only applications that explicitly enable WebSocket compression with setEnablewebSocketCompression(true) are affected. Compression is disabled by default, and exposure requires connecting to an untrusted or compromised WebSocket server, or using an unencrypted ws:// connection where an on-path attacker can alter traffic.
Do webSocketMaxFrameSize and webSocketMaxBufferSize prevent this issue?
No. Those limits apply to compressed bytes because frame aggregation occurs before inflation; they do not limit the decompressed permessage-deflate payload size.
What can happen during exploitation?
A message of roughly 2 MiB can inflate to roughly 2 GiB, and the client copies the inflated message again for the listener. This can exhaust the JVM heap; although Netty closes the connection after an OutOfMemoryError, other allocations in the process may fail while the buffer remains live, and repeated messages can sustain heap exhaustion.
What can be done if the application cannot immediately update?
Disable WebSocket compression by avoiding setEnablewebSocketCompression(true). For connections that must remain uncompressed, use trusted servers and avoid ws:// paths where an on-path attacker could inject malicious messages.
How can I determine whether an application is affected?
Review the AsyncHttpClient configuration for setEnablewebSocketCompression(true). If it is not enabled, the described vulnerable compression path is not in use.