GitHub advisory · Maven
Netty has a DNS Codec Input Validation Bypass (Encoder + Decoder)
Description
| Field | Value |
|-------|-------|
| Product | Netty |
| Version | 4.2.12.Final (and all prior versions with codec-dns) |
| Component | io.netty.handler.codec.dns.DnsCodecUtil |
| Vulnerability Type | CWE-20: Improper Input Validation / CWE-626: Null Byte Interaction Error / CWE-400: Uncontrolled Resource Consumption |
| Impact | DNS Cache Poisoning / Domain Validation Bypass / Denial of Service / Malformed DNS Packets |
Both the encoder and decoder in the same file are affected:
io.netty.handler.codec.dns.DnsCodecUtil — encodeDomainName() method (lines 31-51):
io.netty.handler.codec.dns.DnsCodecUtil — decodeDomainName() method (lines 53-118):
Netty's DNS codec does not enforce RFC 1035 domain name constraints during either encoding or decoding. This creates a bidirectional attack surface: malicious DNS responses can exploit the decoder, and user-influenced hostnames can exploit the encoder.
A domain name containing a null byte (e.g., "evil\0.example.com") is encoded with the null byte embedded in the label data. This creates a domain name that different DNS implementations interpret differently:
"evil\0.example.com" as a single label containing a null"evil"Manual fix · Maven
Sources