]> git.ipfire.org Git - thirdparty/bind9.git/commit
Drop malformed notify messages early instead of decompressing them
authoralessio <alessio@isc.org>
Wed, 29 Jan 2025 09:37:33 +0000 (10:37 +0100)
committeralessio <alessio@isc.org>
Tue, 25 Feb 2025 09:40:38 +0000 (10:40 +0100)
commit887502e37d1bbb0673038af2a8fffcaaed4aacaa
tree6e1304ae01afbcfce4d89c74722ecb11ce2920ff
parent4e0b62bf10b05296d9ff92c55bd9df9d278796f1
Drop malformed notify messages early instead of decompressing them

The DNS header shows if a message has multiple questions or invalid
NOTIFY sections. We can drop these messages early, right after parsing
the question. This matches RFC 9619 for multi-question messages and
Unbound's handling of NOTIFY.
To further add further robustness, we include an additional check for
unknown opcodes, and also drop those messages early.

Add early_sanity_check() function to check for these conditions:
- Messages with more than one question, as required by RFC 9619
- NOTIFY query messages containing answer sections (like Unbound)
- NOTIFY messages containing authority sections (like Unbound)
- Unknown opcodes.
bin/tests/system/formerr/tests.sh
lib/dns/include/dns/types.h
lib/dns/message.c