bind9/lib/ns
Ondřej Surý a61f9a09d7
Refuse SIG and NXT records in dynamic updates
SIG (24) and NXT (30) are obsolete DNSSEC record types, superseded by
RRSIG and NSEC in RFC 3755.  Allowing them through dynamic update
exposes two distinct bugs that the surrounding GL#5818 work already
fixes as defense-in-depth:

  - dns__db_findrdataset() used to REQUIRE that (covers == 0 ||
    type == RRSIG), which aborts named when a SIG update reaches the
    prescan foreach_rr() call.  Fixed to accept dns_rdatatype_issig().
  - diff.c rdata_covers() used to test only RRSIG, dropping the
    covered-type field for SIG rdatas; the zone DB then filed every
    SIG rdataset under typepair (SIG, 0) instead of
    (SIG, covered_type) and follow-up adds collided at that bucket.
    Fixed to use dns_rdatatype_issig().

Both underlying bugs are still reachable via inbound zone transfer
(diff.c rdata_covers() runs from both dns_diff_apply on the IXFR path
and dns_diff_load on the AXFR path), so the type-helper fixes above
remain necessary.  For the dynamic-update path, the simplest and
safest posture is to refuse SIG and NXT outright at the front door in
ns/update.c, alongside the existing NSEC/NSEC3/non-apex-RRSIG
refusals.  KEY remains permitted because it is still used to carry
public keys for SIG(0) transaction authentication.

The existing tcp-self SIG regression test is repointed to assert
REFUSED on the SIG add, a symmetric NXT test is added, and the
SIG-via-dyn-update covers-bucket test is removed because it is no
longer reachable through this entry point; AXFR-based coverage of
diff.c rdata_covers() follows in a separate commit.

(cherry picked from commit 3a44a13232)
2026-04-20 11:21:14 +02:00
..
include Use clang-format-22 to update formatting 2026-03-04 12:24:53 +01:00
client.c Use clang-format-20 to update formatting 2025-06-25 13:59:44 +10:00
hooks.c standardize CHECK and RETERR macros 2025-12-03 19:18:12 -08:00
interfacemgr.c Remove --with-tuning=small/large configuration option 2025-01-22 14:16:40 +01:00
listenlist.c Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
log.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
Makefile.am Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
notify.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
query.c Clear serve-stale flags when following the CNAME chains 2026-02-25 17:17:07 +01:00
server.c Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
sortlist.c Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
stats.c Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
update.c Refuse SIG and NXT records in dynamic updates 2026-04-20 11:21:14 +02:00
xfrout.c standardize CHECK and RETERR macros 2025-12-03 19:18:12 -08:00