Headline
CVE-2022-3347: RRSIG name was not being checked · Issue #5 · peterzen/goresolver
DNSSEC validation is not performed correctly. An attacker can cause this package to report successful validation for invalid, attacker-controlled records. Root DNSSEC public keys are not validated, permitting an attacker to present a self-signed root key and delegation chain.
The RRSIG’s header name specifies the signer of this signature record. For the leaf query, it should be equal to the FQDN of the querying domain name. e.g. If I query for A records for example.com, I should get back an RRSIG with header name example.com… Then I follow the auth chain of that name to verify the chain of trust.
However, this library didn’t check the equality between the return RRSIG header name, and is using it directly for checking the chain of trust. This means, an attacker can forge RRSIG for any domain by owning a valid domain name. e.g. when a victim query for A records for example.com, an attacker who owns pwn.com can generate a signature for a fake RR response set using its valid DNSKEY, and attach the RRSIG with header name of pwn.com and send it back to the victim. Because this library takes the RRSIG header name without any checks, it query for DNSKEY for pwn.com and use that key to verify the RR set that should answer the query for example.com, and the check would pass.
Related news
go-resolver's DNSSEC validation is not performed correctly. An attacker can cause this package to report successful validation for invalid, attacker-controlled records. Root DNSSEC public keys are not validated, permitting an attacker to present a self-signed root key and delegation chain.