GitHub advisory · Maven
DNSJava DNSSEC Bypass
Description
Records in DNS replies are not checked for their relevance to the query, allowing an attacker to respond with RRs from different zones.
DNS Messages are not authenticated. They do not guarantee that
Applications utilizing DNSSEC generally expect these guarantees to be met, however DNSSEC by itself only guarantees the first two. To meet the third guarantee, resolvers generally follow an (undocumented, as far as RFCs go) algorithm such as: (simplified, e.g. lacks DNSSEC validation!)
QNAME the name you are querying (e.g. fraunhofer.de.), and initialize a list of aliasesQNAME, return it (and optionally return the list of aliases as well)QNAME, add it to the list of aliases. Set QNAME to the CNAME's target and go to 2.QNAME does not have any PTR, CNAME and DNAME records using valid NSEC or NSEC3 records. Return null.Note that this algorithm relies on NSEC records and thus requires a considerable portion of the DNSSEC specifications to be implemented. For this reason, it cannot be performed by a DNS client (aka application) and is typically performed as part of the resolver logic.
dnsjava does not implement a comparable algorithm, and the provided APIs instead return either
If applications blindly filter the received results for RRs of the desired record type (as seems to be typical…
Manual fix · Maven
Sources