diff --git a/CHANGELOG b/CHANGELOG index b34d4ea..fe34575 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,11 @@ version 2.94 which arrises from the same mistake, Credit to Georgi Steffenhagen (ServerTec IT Engineering) for this one. + Fix possible DNSSEC bypass in prove_non_existence_nsec() + Thanks to 전승훈 for finding this bug, it's + a repeat of the problems seen in CVE-2026-4891. + + version 2.93 Fix a corner-case in DNSSEC validation with wildcards. If we have a wildcard record *.example.com and receive a query for diff --git a/src/dnssec.c b/src/dnssec.c index 8b70aa4..29300f9 100644 --- a/src/dnssec.c +++ b/src/dnssec.c @@ -1292,7 +1292,9 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi GETSHORT(rdlen, p); psave = p; - if (!extract_name(header, plen, &p, workspace2, EXTR_NAME_EXTRACT, 0)) + /* If the name is longer that rdlen, then our bitmap code gets + very confused. Doing that deliberately can bypass type bitmap checks. */ + if (!extract_name(header, plen, &p, workspace2, EXTR_NAME_EXTRACT, 0) || (p - psave > rdlen)) return DNSSEC_FAIL_BADPACKET; /* If NSEC comes from wildcard expansion, use original wildcard