/

CVE-2025-71058

Severity:

CRITICAL RISK

(9.1)

DNS Cache Poisoning / Improper Remote Code Specification

CVE-2025-71058

Awaiting Analysis

Vulnerability type

Category:

DNS Cache Poisoning / Improper Remote Code Specification

CWE:

CWE-94

Impact:

Traffic Redirection and DNS Cache Poisoning

Severity:

CRITICAL RISK

(9.1)

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

Dual DHCP DNS Server 8.01 accepts and caches DNS responses based primarily on the transaction ID (TXID) without confirming that the reply was sent by an authorized upstream DNS server.

This behavior allows a remote attacker to forge DNS responses, poison the server's cache, and cause clients to be redirected to attacker-controlled domains or infrastructure.

Affected context

The vulnerability occurs in deployments where Dual DHCP DNS Server 8.01 is used as an authoritative or recursive resolver and is configured to forward queries to upstream DNS servers.

Instead of strictly validating the source IP and other properties of incoming DNS responses, the server primarily relies on the TXID to match responses to outstanding queries.

In environments where the DNS server is reachable over UDP from untrusted networks, this insufficient validation creates an opportunity for attackers to inject forged DNS records into the cache.

Exploit preconditions

  • Attack surface: UDP-based DNS service exposed to or reachable by an attacker (e.g., from the internet or an untrusted network segment).
  • Required access: Ability to send spoofed or forged UDP DNS responses to the Dual DHCP DNS Server; no local access is required.
  • Trigger point: The server issues a DNS query to an upstream resolver, and before the legitimate response arrives, the attacker races it with forged replies that contain a matching TXID and targeted DNS record data.
  • Why exploitation is possible: The server does not reliably verify that the response's source IP and associated metadata correspond to a configured upstream resolver, and relies primarily on TXID matching, which is guessable and brute-forceable over time.

Why this happens

The underlying issue is insufficient validation of DNS responses before accepting them into the cache.

Instead of enforcing strict source validation (e.g., checking that responses originate from configured upstream servers and match expected query parameters), the implementation focuses on matching the transaction ID.

This pattern maps to CWE-94 (Improper Control of Generation of Code) in the sense that untrusted external input is effectively allowed to dictate critical resolution behavior and the authoritative mapping of names to addresses, giving attackers control over where clients are directed.

More broadly, it aligns with the DNS cache poisoning class of vulnerabilities, where untrusted responses are treated as trusted data without robust authenticity checks.

Potential impact

  • Attackers could poison the DNS cache to redirect users to malicious websites (e.g., phishing portals or malware distribution servers).
  • Traffic intended for legitimate services could be transparently routed through attacker-controlled infrastructure for credential theft or interception.
  • Internal services that rely on DNS (APIs, databases, microservices) could be misdirected, leading to data exfiltration or service disruption.
  • Attackers could facilitate large-scale man-in-the-middle (MitM) attacks by controlling the DNS answers for critical domains.
  • Trust in TLS could be weakened if users are tricked into ignoring certificate warnings for spoofed destinations.

General mitigation guidance

Effective mitigation typically focuses on tightening DNS response validation and reducing the trust placed in unauthenticated network inputs:

  • Enforce strict checks that DNS responses originate only from configured upstream resolvers (e.g., matching source IP/port and protocol state).
  • Correlate responses not just by TXID but also by additional parameters such as source/destination tuple, query name, query type, and query class.
  • Prefer secure DNS resolution paths such as DNS over TLS (DoT), DNS over HTTPS (DoH), or DNSSEC validation where feasible, to add authenticity guarantees.
  • Restrict which networks can send DNS traffic to the server using firewalls or access control lists to reduce the exposure of the DNS interface.
  • Apply least privilege to the DNS service environment, segregating it from other critical components to limit damage if cache poisoning is attempted.

How teams detect issues like this

Organizations can approach detection and assessment of this issue through multiple lenses:

  • Static analysis and code review: Look for DNS resolution logic that accepts responses based solely or primarily on TXID matching, without verifying the response's source endpoint against configured upstream servers.
  • Configuration and policy review: Check DNS server configurations for strict upstream server definitions and examine whether responses from arbitrary IP addresses are accepted.
  • Network monitoring: Use IDS/IPS or DNS-aware monitoring tools to flag anomalous DNS responses, such as answers from unexpected IP ranges or high volumes of mismatched TXIDs.
  • Security testing: Conduct focused penetration tests using controlled DNS cache poisoning attempts to validate whether spoofed responses can be inserted into the cache.
  • Automated security scanners that understand DNS protocol semantics can be configured to alert on resolvers exhibiting weak response validation patterns.

Sources

SourceLink
github.comgithub.com/FPokerFace/Security-Advisory/blob/main/CVE-2025-71058/poc.c
github.comgithub.com/FPokerFace/Security-Advisory/tree/main/CVE-2025-71058
sourceforge.netsourceforge.net/projects/dhcp-dns-server/

Frequently asked

questions

Yes. As long as the DNS service is reachable over UDP from the attacker's network and queries are being forwarded upstream, an attacker can attempt to race legitimate responses with forged packets.

No authentication is typically required. The attacker only needs network-level ability to send spoofed or crafted UDP DNS responses to the affected server.

The most robust pattern is to enforce strict validation of DNS responses so that only replies from configured upstream resolvers are accepted, and to correlate responses using more than just the TXID (e.g., source address, port, and query parameters), combined with the adoption of authenticated DNS mechanisms where possible.

Future implementations should treat all network responses as untrusted by default, require strong association between outgoing queries and incoming responses, employ defense-in-depth with DNSSEC or encrypted/authenticated DNS channels, and incorporate protocol-aware security reviews and automated tests around DNS caching logic.

Find out what's already
exploitable in your codebase.