Fix OOB read in find SOA - attacker-controlled minTTL

Thanks to 전승훈 <snowjeon2@cau.ac.kr> for finding this bug, it's
a repeat of the problems seen in CVE-2026-4891.

Their explanation:

find_soa() reads two DNS names from an SOA record's RDATA using
extract_name() — the MNAME and RNAME fields. Both calls pass qlen
(the whole-packet bound) rather than a bound derived from the current record's
rdlen. If either name contains a compression pointer or is long enough,
p can be advanced beyond the actual end of the SOA RDATA. The subsequent
length check CHECK_LEN(header, p, qlen, 20) succeeds whenever the advanced
pointer still happens to fall within the overall packet, even if it is now
past the RDATA boundary. The code then executes:

GETLONG(minttl, p); /* reads 4 bytes from the wrong location */ *ttlp = minttl;

The result is that *ttlp is set to 4 bytes read from an arbitrary location inside
the packet rather than the SOA's actual minimum TTL field. A crafted
upstream reply with a DNS-compressed MNAME or RNAME in the SOA RDATA can
therefore cause dnsmasq  to cache any attacker-chosen TTL for negative responses.

Impact

An attacker who controls or can spoof an upstream DNS response can force
dnsmasq to use an arbitrarily large minimum TTL (up to 2³²−1 seconds ≈ 136 years)
for NXDOMAIN caching, effectively poisoning the negative cache and causing
legitimate domains to appear  non-existent to downstream clients indefinitely.
With a TTL of 0 the same attack can disable negative caching entirely.
This commit is contained in:
Simon Kelley committed 2026-11-30 21:29:13 +00:00
1 parent 5ef5406a0c
commit 035eaa22ad
2 files changed
+7 -2

No files matched your search

+5 -1
View File
@@ -20,8 +20,12 @@ version 2.94
Georgi Steffenhagen (ServerTec IT Engineering) for this one.
Fix possible DNSSEC bypass in prove_non_existence_nsec()
Thanks to 전승훈 <snowjeon2@cau.ac.kr> for finding this bug, it's
Thanks to 전승훈 Seunghoon Jeon for finding this bug, it's
a repeat of the problems seen in CVE-2026-4891.
Fix OOB read in find SOA - attacker-controlled minTTL
Thanks to 전승훈 Seunghoon Jeon for finding this bug, it's
another repeat of the problems seen in CVE-2026-4891.
version 2.93