Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-42579 — netty

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-20 NVD
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Netty has a DNS Codec Input Validation Bypass (Encoder + Decoder)

# Security Vulnerability Report: DNS Codec Input Validation Bypass in Netty (Encoder + Decoder)

1. Vulnerability Summary

| 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 |

2. Affected Components

Both the encoder and decoder in the same file are affected:

  • io.netty.handler.codec.dns.DnsCodecUtilencodeDomainName() method (lines 31-51):
  • No null byte validation in domain name labels
  • No per-label length validation (RFC 1035 max: 63 bytes)
  • No total domain name length validation (RFC 1035 max: 255 bytes)
  • Empty labels silently truncate the domain name
  • io.netty.handler.codec.dns.DnsCodecUtildecodeDomainName() method (lines 53-118):
  • No per-label length validation (max 63)
  • No total domain name length validation (max 255)
  • Unbounded StringBuilder growth from attacker-controlled DNS responses

3. Vulnerability Description

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.

3.1 Encoder Side — Null Byte Injection (CWE-626)

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:

  • Java (full string): sees "evil\0.example.com" as a single label containing a null
  • C/native DNS libraries: truncate at the null byte, seeing only "evil"
  • DNS servers: may accept or reject based on implementation

This differential interpretation enables DNS cache poisoning and domain validation bypass.

3.2 Encoder Side — Overlength Label (RFC 1035 Violation)

Labels exceeding 63 bytes are accepted by the encoder. The length byte is written as a single unsigned byte, so a 200-byte label writes 0xC8 (200) as the length. Per RFC 1035, values 192-255 indicate compression pointers. This means:

  • A 200-byte label length 0xC8 would be interpreted as a compression pointer by standards-compliant DNS parsers
  • This creates parser confusion between label and pointer interpretation

3.3 Encoder Side — Silent Truncation via Empty Labels

```java

encodeDomainName("a..b.com", buf);

// Encodes as: [01] 'a' [00]

// Only "a." is encoded, ".b.com" is silently dropped!

```

An attacker can craft input like "safe-domain..evil.com" which gets truncated to just "safe-domain.", potentially bypassing domain allowlists.

3.4 Decoder Side — Unbounded Memory Allocation

The decoder accepts labels of any length (0-255 bytes) without checking the RFC 1035 per-label limit of 63 bytes or the total domain name limit of 255 bytes. A malicious DNS server can return responses with oversized labels, causing excessive memory allocation.

Root Cause — Encoder

```java

// DnsCodecUtil.java:31-51

static void encodeDomainName(String name, ByteBuf buf) {

if (ROOT.equals(name)) {

buf.writeByte(0);

return;

}

final String[] labels = name.split("\\.");

for (String label : labels) {

final int labelLen = label.length();

if (labelLen == 0) {

break; // NO ERROR - silently truncates!

}

// NO check: labelLen > 63

// NO check: label contains null bytes

// NO check: total name > 255 bytes

buf.writeByte(labelLen); // Can write values > 63!

ByteBufUtil.writeAscii(buf, label); // Null bytes pass through!

}

buf.writeByte(0);

}

```

Root Cause — Decoder

```java

// DnsCodecUtil.java:94-99 (decodeDomainName)

} else if (len != 0) {

if (!in.isReadable(len)) { // Only checks if bytes EXIST, not if len <= 63

throw new CorruptedFrameException("truncated label in a name");

}

name.append(in.toString(in.readerIndex(), len, CharsetUtil.UTF_8)).append('.');

// ^^^^^^ StringBuilder grows WITHOUT any length limit

in.skipBytes(len);

}

```

Missing checks in decoder:

  • No if (len > 63) check per RFC 1035 Section 2.3.4
  • No if (name.length() > 255) check for total domain name length

4. Exploitability Prerequisites

Encoder Side (outbound)

1. An application constructs DNS queries using Netty's DNS codec with user-influenced domain names

2. The constructed DNS packets are sent to DNS servers or resolvers

Decoder Side (inbound)

1. An application uses Netty's codec-dns or resolver-dns mo

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: None.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-42579 is classified as CWE-20: Improper Input Validation. The application accepts input without checking that it has the expected form, so malformed values reach code that assumes they are well formed.

Affected software

CVE-2026-42579 is recorded against 2 packages.

  • io.netty:netty-codec-dns (fixed in 4.1.133.Final)
  • netty (from 4.2.0 up to 4.2.13)

Timeline and source

Published on 7 May 2026 and last revised on 14 May 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
tools.ietf.org (Web)
tools.ietf.org (Web)

Other advisories for this package

io.netty:netty-codec-dns has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-20: Improper Input Validation) in other software:

CVE-2026-42579 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CWE CWE-20
Public Exploit ✅ No
Source NVD
Published 2026-05-07
Updated 2026-08-20
Modified 2026-05-14
Fix URL N/A

Affected Packages

Software From version Fixed in
io.netty:netty-codec-dns 4.1.133.Final
netty 4.2.0 4.2.13

Site Security Check

Is netty part of your stack?

CVE-2026-42579 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026