bind9/bin
Ondřej Surý 0d0f69db89 Bound EDNS option length in dig's process_opt() walk
process_opt() reads the per-option (optcode, optlen) header from the
OPT rdata and then advances the buffer by optlen, both for the COOKIE
branch (via process_cookie()) and for any other optcode.  The walk
itself never compared optlen to the buffer remainder; the only reason
it cannot trip the isc_buffer_forward() REQUIRE today is that
fromwire_opt() (lib/dns/rdata/generic/opt_41.c) already validates each
option's length against the rdata bounds before the rdataset is
handed back, so process_opt() never sees a self-inconsistent rdata.

That upstream guarantee is fine, but it leaves the local walker
trusting an invariant established elsewhere.  Add a defensive check
that just stops the walk when a future caller (a cached message, an
alternate parser, a refactor of the OPT validator) hands process_opt()
a buffer where optlen would run past the end.

Assisted-by: Claude:claude-opus-4-7
2026-05-01 07:19:49 +02:00
..
check Resolve ERR_MISSING_GLUE / ERR_EXTRA_AAAA value collision 2026-04-29 17:31:23 +02:00
confgen Size HMAC key generation buffers to the maximum block size 2026-04-29 19:21:20 +02:00
delv Skip detach when delv's client never created 2026-04-30 10:56:11 +02:00
dig Bound EDNS option length in dig's process_opt() walk 2026-05-01 07:19:49 +02:00
dnssec Reject negative and out-of-range TTLs in dnssec-* tools 2026-04-30 17:40:19 +02:00
include Remove NZF support, make LMDB required for new zone storage 2026-03-18 11:02:33 +01:00
named Run conn_cleanup on isccc_cc_towire failure in control_respond 2026-04-30 06:47:39 +02:00
nsupdate nsupdate does not handle zero length RDATA well 2026-04-09 09:24:47 +10:00
plugins Apply the dns_rdataset_cleanup patch through the codebase 2025-12-17 15:19:55 +01:00
rndc Dump delegation database in 'rndc dumpdb' 2026-03-30 20:41:13 +02:00
tests Reject negative and out-of-range TTLs in dnssec-* tools 2026-04-30 17:40:19 +02:00
tools Remove NZF support, make LMDB required for new zone storage 2026-03-18 11:02:33 +01:00
meson.build replace the build system with meson 2025-06-11 10:30:12 +03:00