bind9/lib
Ondřej Surý a9501a9979
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:06:34 +02:00
..
bind9 Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
dns Switch UDP fetches to TCP on the first response with a wrong query id 2026-05-15 08:06:34 +02:00
irs standardize CHECK and RETERR macros 2025-12-03 19:18:12 -08:00
isc Switch UDP fetches to TCP on the first response with a wrong query id 2026-05-15 08:06:34 +02:00
isccc Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
isccfg standardize CHECK and RETERR macros 2025-12-03 19:18:12 -08:00
ns Clear dns64_aaaaok immediately after use 2026-05-06 07:45:34 +02:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
Makefile.am move samples/resolve.c to bin/tests/system 2021-04-16 14:29:43 +02:00