REDHAT-BUG-2588736: High severity maven/io.netty/netty-codec-base vulnerability
DelimiterBasedFrameDecoder in Netty has an algorithmic complexity flaw when it is configured with a non-line delimiter, such as Delimiters.nulDelimiter() or a custom delimiter. On every decode() call, the decoder searches the whole accumulated buffer for each delimiter, starting from the reader index. It keeps no record of how far it has already scanned. If no delimiter is found and the buffer is still below maxFrameLength, nothing is consumed, so the next inbound fragment triggers a full rescan. The line-delimited configuration is delegated to LineBasedFrameDecoder, which persists a scan offset and is not affected.
A remote peer can exploit this without authentication by sending a stream of bytes that never contains the delimiter, split across many small TCP segments. The total CPU work grows quadratically with the amount of buffered data, up to maxFrameLength. Framing runs before application logic, so no authentication is needed. The result is denial of service: a few such connections can saturate the event-loop threads that service them.
Affected are applications that use DelimiterBasedFrameDecoder with a non-line delimiter. This covers io.netty:netty-codec-base versions 4.2.0.Final through 4.2.18.Final (fixed in 4.2.19.Final) and io.netty:netty-codec versions up to and including 4.1.138.Final (fixed in 4.1.139.Final). Applications that use a line-delimited configuration are not affected.
Affected versions: >= 4.2.0.Final, <= 4.2.18.Final (netty-codec-base); <= 4.1.138.Final (netty-codec) Patched versions: 4.2.19.Final (netty-codec-base); 4.1.139.Final (netty-codec) CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (7.5) CWE: CWE-400, CWE-407 Upstream advisory: https://github.com/netty/netty/security/advisories/GHSA-5h6f-wp3f-6hmv CVE requested by the Netty Project via PSIRTSUPT-32166.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
io.netty:netty-codec-baseto a version that resolves this vulnerability.Fixed in 4.2.19.Final - Upgrade
Upgrade
io.netty:netty-codecto a version that resolves this vulnerability.Fixed in 4.1.139.Final
Event History
Frequently Asked Questions
Which applications are exposed?
Applications are affected when they use DelimiterBasedFrameDecoder with a non-line delimiter, including Delimiters.nulDelimiter() or a custom delimiter. Line-delimited configurations are delegated to LineBasedFrameDecoder and are not affected.
What does an attacker need to trigger the issue?
A remote peer only needs to send data to the framed connection. The attack does not require authentication because framing occurs before application logic.
What traffic pattern causes the highest impact?
The attacker sends bytes that never include the configured delimiter and splits them into many small TCP segments. Each fragment causes the decoder to rescan the accumulated buffer, producing quadratic CPU work until maxFrameLength is reached.
How can I determine whether a deployment is affected?
Inspect the Netty pipeline for DelimiterBasedFrameDecoder instances and identify their delimiter configuration. Instances using a non-line delimiter are affected; line-delimited instances using the delegated LineBasedFrameDecoder behavior are not.
What is the operational impact of exploitation?
A small number of malicious connections can consume enough CPU to saturate the event-loop threads handling them. This can deny service to other connections handled by those threads.