bind9/bin/named
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
..
include Remove the rndc testgen command 2026-04-30 06:35:01 +02:00
.gitignore Complete rewrite the BIND 9 build system 2020-04-21 14:19:48 +02:00
bind9.xsl Disable output escaping in bind9.xsl 2026-05-14 10:00:21 +10:00
builtin.c dns_rdataset_* const parameters 2026-01-30 19:33:42 +01:00
config.c Fix port validation rejecting valid port 65535 2026-03-14 10:11:55 +01:00
control.c Remove the rndc testgen command 2026-04-30 06:35:01 +02:00
controlconf.c Run conn_cleanup on isccc_cc_towire failure in control_respond 2026-04-30 06:47:39 +02:00
dlz_dlopen_driver.c Use clang-format-20 to update formatting 2025-06-25 12:44:22 +10:00
fuzz.c Change the loopmgr to be singleton 2025-07-23 22:44:16 +02:00
geoip.c Remove redundant parentheses from the return statement 2024-11-19 12:27:22 +01:00
log.c switch to CHECK where it wasn't being used 2025-12-03 13:45:42 -08:00
logconf.c standardize CHECK and RETERR macros 2025-12-03 13:26:28 -08:00
main.c Limit TCP pipelining per shared dispatch 2026-04-14 17:48:16 +02:00
meson.build Split NZD functions into a separate compilation unit 2026-03-18 11:02:33 +01:00
named.conf.rst Remove the configblock sphinx extension 2025-06-23 13:45:09 +03:00
named.rst Finalize removal of memory debug flags size and mctx 2024-12-06 02:29:20 +00:00
nzd.c Stop nzd_env_close from chowning through symlinks 2026-04-29 19:18:47 +02:00
os.c implement the systemd notification protocol manually, drop libsystemd 2025-03-27 22:52:41 +03:00
server.c Remove the rndc testgen command 2026-04-30 06:35:01 +02:00
statschannel.c Switch UDP fetches to TCP on the first response with a wrong query id 2026-05-14 15:56:18 +02:00
tkeyconf.c standardize CHECK and RETERR macros 2025-12-03 13:26:28 -08:00
transportconf.c use a standard CLEANUP macro 2025-12-03 13:45:43 -08:00
tsigconf.c use a standard CLEANUP macro 2025-12-03 13:45:43 -08:00
xsl_c.in replace the build system with meson 2025-06-11 10:30:12 +03:00
xsl_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
zoneconf.c Change NSEC3 and NSEC3PARAM struct fields to use isc_region_t 2026-04-02 16:53:18 +02:00