resolved: limit the number of signature validations in a transaction
authorRonan Pigott <ronan@rjp.ie>
Sun, 25 Feb 2024 01:21:24 +0000 (18:21 -0700)
committerAdrian Bunk <bunk@debian.org>
Sun, 25 Aug 2024 19:05:15 +0000 (22:05 +0300)
commitd1abd19f0014b91378bb47e1bbb82cccdc33eaca
treec380fa941df482b21c2c069ebe1afb4130fee9a6
parente149be3e2fc795626085483898610d47ff3f7fb8
resolved: limit the number of signature validations in a transaction

It has been demonstrated that tolerating an unbounded number of dnssec
signature validations is a bad idea. It is easy for a maliciously
crafted DNS reply to contain as many keytag collisions as desired,
causing us to iterate every dnskey and signature combination in vain.

The solution is to impose a maximum number of validations we will
tolerate. While collisions are not hard to craft, I still expect they
are unlikely in the wild so it should be safe to pick fairly small
values.

Here two limits are imposed: one on the maximum number of invalid
signatures encountered per rrset, and another on the total number of
validations performed per transaction.

Gbp-Pq: Name 0002-resolved-limit-the-number-of-signature-validations-i.patch
src/resolve/resolved-dns-dnssec.c
src/resolve/resolved-dns-dnssec.h
src/resolve/resolved-dns-transaction.c