CVE-2026-12969: Dnsmasq: dnsmasq: out-of-bounds read in find_soa() due to missing extrabytes validation
An out-of-bounds read vulnerability exists in dnsmasq's findsoa() function in src/rfc1035.c. When parsing NS section records, extractname() 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.
Other sources
An out-of-bounds read vulnerability was found in dnsmasq's findsoa() function in src/rfc1035.c. The function calls extractname() with extrabytes=0 when parsing NS section records in NXDOMAIN/NODATA responses, which only validates that the DNS name fits within the packet but does not verify that 10 additional bytes exist for the fixed-length fields (type, class, TTL, rdlen). The subsequent GETSHORT/GETLONG macros then unconditionally read 10 bytes past the valid packet boundary.
An attacker controlling a DNS zone can trigger this by returning a crafted NXDOMAIN response where the NS record name (a compression pointer) extends to the packet boundary. The 10-byte over-read typically stays within dnsmasq's over-allocated packet buffer (headroom of 1035 bytes), limiting crash risk, but accesses data outside the logical packet boundary and may read stale heap data from prior DNS transactions.
Upstream fix: https://repo.or.cz/dnsmasq.mirror.git/commit/14094e88beca519c53151184cc4553656672b54f Fixed in: dnsmasq 2.93rc1
— Red Hat
Dnsmasq: dnsmasq: out-of-bounds read in findsoa() due to missing extrabytes validation
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.93-1 - Upgrade
Upgrade
debian/dnsmasqto a version that resolves this vulnerability.Fixed in 2.93-1 - Upgrade
Upgrade
dnsmasqto a version that resolves this vulnerability.Fixed in 2.93rc1 - Compensating control
Mitigate exploitation of the NXDOMAIN-crafted response by restricting which DNS zones/authoritative servers you trust to answer for your clients (prevent attackers from controlling the DNS zone whose NXDOMAIN/NODATA responses can be returned to dnsmasq).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-12969?
CVE-2026-12969 has a medium severity rating of 5.3.
How does CVE-2026-12969 affect Dnsmasq users?
CVE-2026-12969 can lead to out-of-bounds read vulnerabilities when parsing DNS records, potentially exposing user information.
How do I fix CVE-2026-12969?
Users should update Dnsmasq to the latest version where the out-of-bounds read vulnerability is addressed.
Is CVE-2026-12969 exploitable remotely?
Yes, CVE-2026-12969 can be exploited by a remote attacker controlling a DNS zone.
What components of Dnsmasq are affected by CVE-2026-12969?
The vulnerability in CVE-2026-12969 specifically affects the find_soa() function in the Dnsmasq source code.