bind9/tests
Ondřej Surý 38dd0e0ccc Switch UDP fetches to TCP on the first response with a wrong query id
Until now, the dispatcher silently dropped UDP responses from the
expected peer that carried the wrong DNS message id and kept listening
for the correct id to arrive within the read timeout.  An off-path
attacker who knows the destination address and source port of an
outgoing fetch could exploit that quiet retry window to flood the
resolver with guessed responses; with a gigabit link the per-query
success probability grows linearly with the number of guesses that
arrive before the legitimate answer or the timeout.

Treat any such mismatch as a possible spoofing attempt and let the
resolver immediately retry the same query over TCP, the same control
path the truncation handler already uses.

Add a resolver statistics counter - exposed as 'queries retried over TCP
after a response with mismatched query id' in rndc stats and
'MismatchTCP' in the statistics channel

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 11bca1051f)
2026-05-15 08:49:19 +02:00
..
bench Enforce NSEC3 record consistency 2026-02-24 17:10:52 +01:00
dns Switch UDP fetches to TCP on the first response with a wrong query id 2026-05-15 08:49:19 +02:00
include/tests ISC_RUN_TEST_IMPL should use a static declaration 2026-01-29 00:26:35 +11:00
isc Enforce isc_work enqueue loop affinity 2026-03-14 07:52:56 +01:00
isccfg Add none parameter to query-source and query-source-v6 to disable IPv4 or IPv6 upstream queries 2024-12-10 11:58:20 +01:00
libtest Rename 'free' variable to 'nfree' to not clash with free() 2025-07-22 14:28:15 +02:00
ns wrap ns_client_error() for unit testing 2025-02-26 00:55:51 +00:00
.gitignore Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
Makefile.am Move resconf_test.c to tests/dns and cleanup 2024-12-12 22:50:22 +00:00
unit-test-driver.sh.in Reformat shell scripts with shfmt 2023-10-26 10:23:50 +02:00