
A 64 KiB stack buffer, a 16-bit length field, and a record that fills the
buffer exactly. The length wraps to zero, the cache accepts it, and the next
reader aborts the resolver. The second bug is the same idea without the
arithmetic: a parser with no work budget.
What the advisories say
CVE-2026-19667, posted 16 September 2026:
If an attacker-controlled authoritative server can produce a negative answer
that is exactly 65536 bytes, then a flaw innamedresults in a negative
cache entry of 0 bytes. When this entry is subsequently read,namedaborts.
CVE-2026-19630, posted 21 October 2026:
In a BIND resolver, inbound DNS protocol messages with a particular structure
will result in additional processing, with no limit imposed by BIND. A DNS
message with a maliciously large number of such structures will cause BIND to
consume disproportionate amounts of CPU time and memory during processing.
Both carry CVSS 3.1 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H), both are
remotely exploitable, and both are availability bugs. The weaknesses are
CWE-197 (numeric truncation) for 19667 and CWE-407 (inefficient
algorithmic complexity) for 19630.
The 65,536-byte arithmetic
dns_ncache_add() builds a negative cache record in a stack buffer declared as
unsigned char data[65536]. It writes each record's length with a 16-bit
store, and dns_rdata_t.length is itself 16 bits wide.
A record that fills the buffer exactly is 65,536 bytes long. In binary, 65,536
is 1 0000 0000 0000 0000 — seventeen bits. Truncate it to sixteen and you get
zero. The cache records "this record is zero bytes long", which is small enough
to pass the size checks in dns_rdataslab_fromrdataset() that would otherwise
have rejected it. The truncated record is committed. Every later reader trusts
the length, walks a zero-byte buffer, and hits an assertion.
The important detail is how a 65,536-byte record fits in a normal DNS message.
It does so through compression. An authority section that repeats one SOA
record, with its MNAME and RNAME compressed against a long QNAME, expands to
exactly that size on decompression while remaining much smaller on the wire.
The limit is hit in the assembled cache record, not in the packet length.
What the fix actually does
The upstream fix — commit e670209083 on the 9.20 branch, 8b20ed0a64 on 9.21
— does three things in lib/dns/ncache.c:
- Shrinks the stack buffer from
data[65536]todata[UINT16_MAX], so the
exact-fill case cannot occur. - Adds an explicit range check before storing the length:
if (r.length > DNS_RDATA_MAXLENGTH) return ISC_R_NOSPACE; - Rejects duplicate SOA records and singleton RRsets with more than one
record, closing the assembly path that could produce the oversized record in
the first place.
It is a range check, not an architectural change. The 16-bit field is part of
the protocol; the fix belongs where the value is produced.
The other bug: no work budget
CVE-2026-19630 is the same theme without a magic number. The parser follows
compression pointers, and a pointer that points at another pointer adds no
bytes. A message can therefore contain thousands of names, each expanding
through a shared chain, at a cost far above its size on the wire.
The upstream fix — b606d21aaf on 9.20, 0405d33e2a on 9.21 — introduces a
decompression budget:
- Every message gets a budget of four pointer follows per byte of message
length (DNS_MESSAGE_MAXHOPSPERBYTE 4). - The budget is shared across all names in the message, so many small names
cannot each stay under a per-name limit while collectively doing unbounded
work. - When the budget is exhausted,
namedanswers FORMERR instead of
continuing.
Four follows per byte is generous for legitimate traffic and far below what an
amplifier needs.
Why this is the fundamental flaw
Both bugs trust a size the protocol does not bound the way the code assumes:
names can expand, lengths are 16 bits, and the parser is reachable by anyone.
The corpus suggested wrong answers or cache poisoning. The documented impact is
narrower: an assertion failure and a crash — still a denial of service against
every client behind the resolver.

Next: Part 8 — the patch that isn't in your branch: the 9.18 end-of-life
trap, the real fixed-version matrix, and how to tell what you are running.

Comments (0)