MEDIUM 5.3

CVE-2026-12969: dnsmasq Heap Out-of-Bounds Read via Crafted NXDOMAIN Response

dnsmasq, a widely-deployed DNS and DHCP server, contains an out-of-bounds read flaw in how it processes DNS response packets. When a remote attacker controls a DNS zone and sends a specially crafted NXDOMAIN response, the vulnerable code reads 10 bytes beyond the intended buffer boundary in heap memory. This can expose residual data from previous DNS transactions—potentially including DNS queries, cached responses, or other transient information—without crashing the service. The vulnerability requires network access and DNS zone control but does not demand user interaction.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weaknesses (CWE)
CWE-125
Affected products
2 configuration(s)
Published / Modified
2026-06-23 / 2026-07-08

NVD description (verbatim)

An out-of-bounds read vulnerability exists in dnsmasq's find_soa() function in src/rfc1035.c. When parsing NS section records, extract_name() is called with extrabytes=0, failing to validate that 10 additional bytes exist for fixed-length DNS record fields. A remote attacker controlling a DNS zone can exploit this via a crafted NXDOMAIN response to cause a 10-byte heap out-of-bounds read, potentially accessing stale data from prior transactions.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-12969 is a heap out-of-bounds read in dnsmasq's find_soa() function (src/rfc1035.c). The root cause is improper validation during DNS packet parsing: the extract_name() function is invoked with extrabytes=0 when processing NS section records in NXDOMAIN responses, omitting the 10-byte buffer space required for fixed-length DNS record fields that follow the name. A remote attacker who controls a DNS zone can craft an NXDOMAIN response that triggers this condition, causing dnsmasq to read 10 bytes from heap memory beyond the legitimate packet boundary. The leaked data is not under attacker control but reflects whatever was previously allocated in that heap region. The CWE classification is CWE-125 (Out-of-bounds Read).

Business impact

Information disclosure is the primary concern. If dnsmasq is exposed to untrusted DNS sources or if an attacker can poison zone delegations, stale heap contents may leak. In environments where dnsmasq forwards queries or serves as a resolver for sensitive workloads, this could expose fragments of prior queries or responses. The attack requires DNS zone control, limiting the threat surface; opportunistic exploitation via public DNS services is less practical. However, in split-view DNS or internal zone scenarios where an attacker has zone authority, repeated exploitation could yield meaningful data. Service availability is not directly compromised—dnsmasq does not crash from this read violation.

Affected systems

dnsmasq versions affected by this vulnerability are those prior to the patched release. Red Hat Enterprise Linux distributions that bundle vulnerable dnsmasq versions are at risk, as are standalone dnsmasq deployments. The vulnerability applies specifically to code processing DNS responses with NXDOMAIN status and NS section records. Verify your exact dnsmasq version against the vendor advisory to confirm exposure.

Exploitability

Exploitation is straightforward from a network standpoint: an attacker must control a DNS zone (or intercept/poison DNS responses) and send a malformed NXDOMAIN packet. No authentication, credentials, or user interaction is required. The attack surface is broad if dnsmasq is exposed to untrusted recursive queries or downstream from insecure DNS paths. However, the utility of exploitation depends on whether leaked heap data contains sensitive information—heap spraying or heap feng shui techniques might improve information recovery, though such tactics are not disclosed in public analysis. CVSS 3.1 assigns a score of 5.3 (MEDIUM severity), reflecting low confidentiality impact and no integrity or availability impact. The vulnerability is not currently tracked in CISA's Known Exploited Vulnerabilities catalog.

Remediation

Apply vendor patches immediately. For Red Hat Enterprise Linux, consult Red Hat Security Advisories for your specific release. For upstream dnsmasq, update to a patched version—verify the exact version number in the official dnsmasq release notes or GitHub repository. There is no known workaround; patching is the only mitigation. If immediate patching is infeasible, restrict DNS query sources and monitor for suspicious zone delegation patterns.

Patch guidance

1. Identify your dnsmasq version: check rpm -qa dnsmasq (RHEL) or dnsmasq --version (standalone). 2. Cross-reference against Red Hat Bugzilla or the dnsmasq GitHub repository to confirm the patched version for your release stream. 3. Test the patch in a non-production environment first, particularly if dnsmasq handles DHCP or serves critical split-view zones. 4. Redeploy and verify DNS resolution continues normally post-patch. 5. Confirm via version check that the patched code is running.

Detection guidance

Intrusion detection is limited because the exploit produces no obvious error signatures—dnsmasq silently performs the out-of-bounds read. Monitor for: (1) NXDOMAIN responses with malformed NS sections in your DNS query logs or packet captures, especially from unexpected sources; (2) unusual heap corruption warnings in dnsmasq debug logs if enabled; (3) repeated DNS queries to non-existent subdomains under a domain you do not control, which might indicate exploit probing. Network segmentation and DNS query whitelisting reduce exposure. Endpoint Memory Tagging Extension (MTE) or AddressSanitizer in debug builds can catch the violation if available.

Why prioritize this

This vulnerability merits prompt but not emergency patching. The CVSS 5.3 (MEDIUM) score reflects genuine but limited impact: information disclosure without authentication barriers is concerning, but the threat requires DNS zone control and does not affect availability. Prioritize patching for dnsmasq instances serving high-value networks, handling sensitive queries, or facing untrusted DNS sources. Lower priority for internal resolvers in well-segmented networks where DNS sources are tightly controlled. The fact that this is not on CISA's KEV list suggests limited active exploitation in the wild, but do not rely on this alone—vendor advisories and your own threat model should guide timeline.

Risk score, explained

CVSS 3.1 score of 5.3 is assigned under the MEDIUM severity band. The vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N reflects: Attack Vector Network (exploitable remotely), Attack Complexity Low (no special conditions beyond DNS zone control), Privileges Required None (unauthenticated), User Interaction None, Scope Unchanged, Confidentiality Low (heap data leakage), Integrity None (no modification), Availability None (no denial of service). The score reasonably balances the ease of exploitation with the limited impact; organizational risk depends on your DNS topology and data sensitivity.

Frequently asked questions

Can this vulnerability allow an attacker to execute code or take down my DNS service?

No. This is an out-of-bounds read, not a write. dnsmasq will not crash or execute arbitrary code. The sole risk is that 10 bytes of heap memory—leftover data from prior operations—may be read and potentially disclosed. Service availability is not affected.

Do I need to be running dnsmasq on the public internet to be at risk?

Not necessarily. The attacker must control a DNS zone or poison DNS responses, which is easier on untrusted networks but possible within compromised internal infrastructure. If dnsmasq only forwards to trusted upstream resolvers and handles no external zone delegations, your risk is lower. However, if dnsmasq is authoritative for any zones or receives queries from untrusted clients, you are at greater risk.

What data could be leaked by this vulnerability?

The leaked 10 bytes come from heap memory and reflect whatever was previously allocated there—typically fragments of prior DNS packets, cached data, or other transient state. An attacker cannot directly control what is leaked, but repeated exploitation might allow information gathering. Sensitive data such as full DNS queries or credentials is unlikely but possible depending on dnsmasq's memory layout and workload.

How do I know if my dnsmasq instance has been compromised by this vulnerability?

There are no definitive log signatures, as dnsmasq does not error on the out-of-bounds read. Review DNS query logs for NXDOMAIN responses from unexpected sources or suspicious patterns. If you suspect exposure, upgrade to the patched version immediately and consider a log audit if you retain detailed DNS request/response captures. A security assessment of heap state is impractical without memory forensics or specialized tools.

This analysis is based on publicly available CVE data and vendor advisories current as of the published date. CVSS scores and severity ratings are as provided by the National Vulnerability Database. Actual risk and exploitability may vary depending on your specific dnsmasq version, network topology, and threat model. Consult Red Hat Security Advisories and the dnsmasq project's official releases for authoritative patch information and version numbers. SEC.co does not provide legal, compliance, or incident response services; this intelligence is for informational purposes to support your security decision-making. Always validate findings in your own environment before taking remediation action. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).