bind9/bin/tests
Ondřej Surý 11bca1051f
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
2026-05-14 15:56:18 +02:00
..
startperf Reformat shell scripts with shfmt 2023-10-26 10:23:50 +02:00
system Switch UDP fetches to TCP on the first response with a wrong query id 2026-05-14 15:56:18 +02:00
testdata/wire move all optional tests from bin/tests to bin/tests/optional 2018-03-09 14:12:47 -08:00
.gitignore Move environment variables from conf.sh to pytest 2024-05-09 17:08:08 +02:00
meson.build replace the build system with meson 2025-06-11 10:30:12 +03:00
test_client.c Add and use global memory context called isc_g_mctx 2025-08-04 11:29:26 +02:00
test_server.c Add and use global memory context called isc_g_mctx 2025-08-04 11:29:26 +02:00