]> git.ipfire.org Git - thirdparty/bind9.git/commit
Reject RSA DNSKEYs with oversize public exponents at parse time
authorOndřej Surý <ondrej@isc.org>
Thu, 30 Apr 2026 05:01:53 +0000 (07:01 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 30 Apr 2026 10:20:30 +0000 (12:20 +0200)
commitca6ea809b0faff3ea59aeae2a00d580842f70f4b
tree90a7b53e9d952642529ef5fec16e7a5b2833deb3
parent9a969bf1bc7589647f09b388abf606c1b7523519
Reject RSA DNSKEYs with oversize public exponents at parse time

The wire-format RSA DNSKEY parser was the only key path with no upper
bound on the public exponent — opensslrsa_parse and opensslrsa_fromlabel
already cap at RSA_MAX_PUBEXP_BITS.  An attacker-controlled DNSKEY could
therefore force a validator to compute s^e mod n with e up to ~|n| bits,
amplifying every verify by ~120x for typical 2048-bit moduli (OpenSSL
itself only caps the exponent for moduli above 3072 bits).  Apply the
same bit-count cap to wire-format keys.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit ab8c1a77e06bf7fc969ad1fac20c3ae5a96257e5)
lib/dns/opensslrsa_link.c
tests/dns/rsa_test.c