CVE-2026-142440: Io.netty/netty-codec-dns: netty: dns codec decoders materialize records from uncapped 16-bit counts (quadratic allocation)
A flaw was found in netty-codec-dns. A remote attacker could exploit this vulnerability by sending specially crafted Domain Name System (DNS) messages with oversized record counts to an affected system. Due to missing record limits and excessive memory allocations during message parsing, processing these crafted messages consumes disproportionate system memory and processing time. This can lead to severe application responsiveness issues or a Denial of Service (DoS).
Other sources
The DNS decoders in netty-codec-dns build message records from the attacker-controlled 16-bit section counts (QDCOUNT, ANCOUNT, NSCOUNT, ARCOUNT) with no per-message record limit and no check of the counts against the message length. Each record name is decoded by DnsCodecUtil.decodeDomainName, which sizes its working StringBuilder to twice the entire remaining message buffer instead of the 255-character maximum name length. The per-name length check runs only after that allocation has been made. A single frame-legal message of about 64 KiB can therefore produce thousands of records, each with an oversized allocation, so total work grows quadratically with the frame size.
A remote, unauthenticated peer can use this to cause a denial of service. In testing, one 64 KiB message materialized about 4,661 records and caused about 325 MiB of transient heap allocation, roughly 5,000 times the on-wire size, on the synchronous I/O thread. A sustained low-bandwidth flood can saturate garbage collection and stall the event loop, denying service to every connection handled by that loop.
Affected are users of netty-codec-dns that decode DNS messages from untrusted peers, including DNS servers using TcpDnsQueryDecoder or DatagramDnsQueryDecoder, and DNS clients such as those using netty-resolver-dns with DnsResponseDecoder. Versions up to and including 4.1.138.Final, and 4.2.0.Final through 4.2.18.Final, are affected. The issue is fixed in 4.1.139.Final and 4.2.19.Final.
Affected versions: >= 4.2.0.Final, <= 4.2.18.Final; <=4.1.138.Final Patched versions: 4.2.19.Final; 4.1.139.Final 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-405 Upstream advisory: https://github.com/netty/netty/security/advisories/GHSA-3h79-3wcf-5whr CVE requested by the Netty Project via PSIRTSUPT-32166.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
io.netty/netty-codec-dnsto a version that resolves this vulnerability.Fixed in 4.1.139.Final - Upgrade
Upgrade
io.netty/netty-codec-dnsto a version that resolves this vulnerability.Fixed in 4.2.19.Final
Event History
Frequently Asked Questions
Which deployments are exposed to exploitation?
Applications that use the affected DNS decoders in netty-codec-dns to parse DNS messages from remote peers are exposed. The attack can be performed by a remote, unauthenticated peer.
What must an attacker send to trigger the resource exhaustion?
An attacker must send specially crafted DNS messages with attacker-controlled section counts, including QDCOUNT, ANCOUNT, NSCOUNT, or ARCOUNT. A frame-legal message of about 64 KiB can cause thousands of record decodes and oversized per-name allocations.
What is the expected security impact?
The issue affects availability: processing malicious messages can consume disproportionate memory and CPU time, severely degrading responsiveness or causing denial of service. The provided vector indicates no confidentiality or integrity impact.