Simon Kelley 035eaa22ad 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.
2026-11-30 21:29:13 +00:00
2012-04-02 20:40:34 +01:00
2025-12-07 13:44:40 +00:00
2012-01-05 17:31:15 +00:00
2018-01-14 17:32:52 +00:00
2022-05-13 21:22:11 +01:00
2012-01-05 17:31:13 +00:00
2025-07-20 15:29:43 +01:00
2021-06-15 23:14:59 +01:00
2026-04-08 12:08:18 +01:00
2025-07-20 15:29:43 +01:00
2012-01-05 22:00:08 +00:00
S
Description
No description provided
GPL-2.0
6.6 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 94.3%
Perl 2.2%
HTML 1.2%
Shell 1%
Makefile 0.6%
Other 0.6%