Netty MQTT: Resource exhaustion in MqttDecoder
Package
Affected versions
>= 4.2.0.Alpha1, <= 4.2.12.Final
<= 4.1.132.Final
Patched versions
4.2.13.Final
4.1.133.Final
Description
Published to the GitHub Advisory Database
May 7, 2026
Reviewed
May 7, 2026
Published by the National Vulnerability Database
May 13, 2026
Last updated
May 14, 2026
Impact
The MQTT 5 header Properties section is parsed and buffered before any message size limit is applied.
Specifically, in
MqttDecoder, thedecodeVariableHeader()method is called before thebytesRemainingBeforeVariableHeader > maxBytesInMessagecheck. ThedecodeVariableHeader()can call other methods which will calldecodeProperties(). Effectively, Netty does not apply any limits to the size of the properties being decoded.Additionally, because
MqttDecoderextendsReplayingDecoder, Netty will repeatedly re-parse the enormous Properties sections and buffer the bytes in memory, until the entire thing parses to completion.This can cause high resource usage in both CPU and memory.
Resources
ANT-2026-09608https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901027
References