]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Reject meta-classes in UPDATE and NOTIFY messages
authorMark Andrews <marka@isc.org>
Tue, 3 Mar 2026 23:00:56 +0000 (10:00 +1100)
committerOndřej Surý <ondrej@isc.org>
Thu, 7 May 2026 13:14:06 +0000 (15:14 +0200)
NOTIFY and UPDATE messages must specify a data class in the
QUESTION/ZONE section.  NONE and ANY are meta-classes and not
appropriate here.  Return FORMERR if either is used.

Rejecting messages with a query class of NONE addresses YWH-PGM40640-72,
YWH-PGM40640-82, and YWH-PGM40640-83.  Rejecting messages with a query
class of ANY addresses YWH-PGM40640-87, YWH-PGM40640-88, and
YWH-PGM40640-117.

Fixes: isc-projects/bind9#5778
Fixes: isc-projects/bind9#5782
Fixes: isc-projects/bind9#5783
Fixes: isc-projects/bind9#5797
Fixes: isc-projects/bind9#5798
Fixes: isc-projects/bind9#5853
(cherry picked from commit 7de5160517ae69196d1c323b8627b267cdd10761)
(cherry picked from commit 3c44de9e6252ec1c7742ef02ecc0d6cbf1cde5e9)

lib/dns/message.c

index 8a010a8e9d79ac5558545d4eb4270dac4c2cf5f4..e7d66d38a3183cd5b3e8fd9c1274401b4b002b5d 100644 (file)
@@ -1179,6 +1179,17 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
                rdtype = isc_buffer_getuint16(source);
                rdclass = isc_buffer_getuint16(source);
 
+               /*
+                * Notify and update messages need to specify the data class.
+                */
+               if ((msg->opcode == dns_opcode_update ||
+                    msg->opcode == dns_opcode_notify) &&
+                   (rdclass == dns_rdataclass_none ||
+                    rdclass == dns_rdataclass_any))
+               {
+                       DO_ERROR(DNS_R_FORMERR);
+               }
+
                /*
                 * If this class is different than the one we already read,
                 * this is an error.