]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix RRL responses-per-second bypass using wildcard names
authorAram Sargsyan <aram@isc.org>
Mon, 25 Jul 2022 13:55:03 +0000 (13:55 +0000)
committerMichał Kępień <michal@isc.org>
Thu, 8 Sep 2022 07:36:50 +0000 (09:36 +0200)
commit35e37505f08d9fd8ea3ac08a78fb73315a39965e
tree8d07c41033ddb8a6609cab07bdb542ab715a5e7e
parentfe162c74c1af725120537f8f205276cbf8dd2c9c
Fix RRL responses-per-second bypass using wildcard names

It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.

(cherry picked from commit baa9698c9d4bed741cdff14a07f1c71c81b21908)
bin/tests/system/rrl/tests.sh
lib/dns/include/dns/rrl.h
lib/dns/rrl.c
lib/ns/client.c
lib/ns/query.c