/

CVE-2026-42579

Severity:

HIGH RISK

(7.5)

Improper Input Validation in Netty Framework

CVE-2026-42579

Modified

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20, CWE-400, CWE-626, CWE-1286

Impact:

Protocol Abuse and Potential Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Netty's DNS codec fails to enforce RFC 1035 domain name constraints when encoding and decoding DNS messages, allowing malformed hostnames and responses to pass through unchecked.

Under these conditions, both attacker-controlled DNS responses and user-influenced hostnames can trigger unexpected behavior in clients or upstream consumers, expanding the attack surface on applications built with Netty.

Affected context

This issue affects applications that:

  • Use Netty's DNS codec (e.g., codec-dns) for DNS resolution or DNS message handling
  • Accept hostnames or domain names influenced by users, external systems, or untrusted configuration
  • Rely on Netty to enforce DNS protocol rules instead of performing their own validation

The problem arises when domain names are encoded into DNS queries or decoded from DNS responses without verifying that they conform to RFC 1035 limits (lengths, label formats, and structure).

Exploit preconditions

  • Attack surface (decoder side):
  • The application processes DNS responses via Netty's DNS codec.
  • An attacker can supply or influence DNS responses (e.g., via a malicious DNS server, MITM, or DNS spoofing).
  • Attack surface (encoder side):
  • The application uses Netty's DNS codec to construct DNS queries or messages based on hostnames.
  • An attacker can influence the hostname or domain name (e.g., HTTP Host header, user input, configuration).
  • Required access:
  • Network-level capability to provide or tamper with DNS responses, or
  • Logical access to fields that are ultimately used as hostnames in DNS messages.
  • Trigger point:
  • DNS messages are encoded or decoded by Netty without RFC 1035 validation, allowing malformed or oversized names to flow through.
  • Why exploitation is possible:
  • The codec trusts the input domain names and does not enforce protocol-level constraints, enabling malformed data that can stress downstream components, cause unexpected parsing paths, or consume excessive resources.

Why this happens

The root cause is insufficient validation of domain names in the DNS codec, mapping to CWE-20: Improper Input Validation.

RFC 1035 specifies constraints on DNS names, such as maximum length, label size, and character rules.

Netty's codec fails to consistently apply these constraints during both encoding (outgoing queries) and decoding (incoming responses).

As a result:

  • Malformed or oversized domain names can be processed as if they were valid protocol data.
  • Both directions of the DNS pipeline become vulnerable: inbound responses can drive the decoder into unexpected states, and outbound messages can propagate invalid data to other systems.

The associated CWE-400 (Uncontrolled Resource Consumption) and CWE-626 (Null Byte Interaction Error) reflect typical secondary risks: malformed, oversized, or specially crafted names can cause excessive resource use, edge-case parsing behavior, or incorrect string termination in downstream consumers.

Potential impact

  • DNS handling components may experience denial of service due to excessive resource consumption when parsing or constructing malformed names.
  • Applications may forward or log malformed domain names, potentially impacting downstream libraries, proxies, or monitoring systems.
  • Protocol confusion or parsing inconsistencies in client or server components that assume valid RFC 1035 data.
  • Increased exposure to secondary parsing vulnerabilities in other stacks that receive these malformed DNS messages.
  • Reduced reliability and predictability of name resolution flows, leading to intermittent failures or degraded service.

General mitigation guidance

Mitigation focuses on enforcing strict domain name validation and reducing trust in inbound and outbound DNS data:

  • Enforce RFC 1035 validation at boundaries:
  • Validate hostnames before passing them to the DNS codec, including label length, total length, allowed characters, and structural rules.
  • Reject or sanitize domain names that do not comply with protocol constraints.
  • Harden DNS response handling:
  • Treat all DNS responses as untrusted input; perform additional checks on decoded names (length, format, presence of unexpected characters) before using them in application logic, logs, or UI.
  • Apply resource and size limits:
  • Impose strict upper bounds on DNS message sizes, number of questions/answers, and maximum allowed domain name length within your own application logic.
  • Use timeouts and circuit breakers around DNS operations to limit resource exhaustion effects.
  • Reduce privilege and blast radius:
  • Run DNS-handling components with least privilege and clear isolation so failures or resource spikes don't cascade to critical services.
  • Segregate DNS resolution logic from core business workflows where feasible.
  • Defensive configuration patterns:
  • Centralize hostname parsing and validation into well-reviewed helpers rather than duplicating ad-hoc checks.
  • Apply consistent validation rules for any input that might eventually be used as a DNS name, regardless of the initial protocol (HTTP, gRPC, CLI, etc.).

How teams detect issues like this

Effective detection relies on combining code-centric and behavior-centric techniques:

  • Static analysis and code scanning:
  • Flag usages of Netty's DNS codec where domain names originate from user input or untrusted configuration without intervening validation.
  • Define patterns that require hostname validation functions to be present in call chains leading into DNS encoding.
  • Code review focus areas:
  • Examine all modules that:
  • Create or manipulate DNS questions, records, or messages.
  • Decode DNS responses and propagate names into logs, caches, or secondary protocols.
  • Look for missing length checks, unconstrained concatenation, or acceptance of arbitrary strings as hostnames.
  • Runtime monitoring and logging:
  • Log DNS queries and responses (with appropriate privacy filtering) and alert on:
  • Domain names that exceed normal length thresholds.
  • Names containing unusual characters or structures.
  • Track spikes in DNS-related errors, timeouts, or resource usage as potential indicators of malformed input.
  • Security testing:
  • Use fuzzing and protocol-aware testing tools against DNS handling paths to reveal how malformed domain names are processed.
  • Integrate these tests into CI to catch regressions in validation logic.

Sources

SourceLink
github.comgithub.com/netty/netty/security/advisories/GHSA-cm33-6792-r9fm
access.redhat.comaccess.redhat.com/errata/RHSA-2026:23808
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24502
access.redhat.comaccess.redhat.com/errata/RHSA-2026:25123
access.redhat.comaccess.redhat.com/errata/RHSA-2026:28010
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36820
access.redhat.comaccess.redhat.com/errata/RHSA-2026:37390
access.redhat.comaccess.redhat.com/errata/RHSA-2026:49700
access.redhat.comaccess.redhat.com/errata/RHSA-2026:49701
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53644
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53645
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53646
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54435
access.redhat.comaccess.redhat.com/errata/RHSA-2026:65126
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-42579
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2477217
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42579.json

Frequently asked

questions

Exploitability depends on how an application uses Netty's DNS codec. If DNS responses can be influenced by an attacker (e.g., via a malicious resolver or spoofed responses) or hostnames are derived from user input, the codec's lack of validation may be reachable and increase overall risk.

Not necessarily. An attacker could operate as, or control, a DNS server that the application queries, or they could supply hostnames through higher-level protocols (such as HTTP or configuration APIs) that are later passed into the DNS codec.

Enforce strict RFC-compliant validation of domain names at all ingress points and prior to DNS encoding or use, and treat all decoded DNS names as untrusted data that must pass validation before further processing or logging.

Adopt a defense-in-depth approach for protocol handling: use libraries that enforce protocol constraints by default, centralize and reuse robust validation routines, add size and complexity limits to all external inputs, and include protocol fuzzing and static analysis checks in your standard development and review workflows.

Find out what's already
exploitable in your codebase.