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 usage for dnsjava), a rogue recursive resolver or (on UDP/TCP connections) a network attacker can
DNS(SEC) libraries are usually used as part of a larger security framework. Therefore, the main misuses of this vulnerability concern application code, which might take the returned records as authentic answers to the request. Here are three concrete examples of where this might be detrimental:
At this point, the following mitigations are recommended:
LookupSession.lookupAsync
.{ "nvd_published_at": "2024-07-22T14:15:04Z", "cwe_ids": [ "CWE-345", "CWE-349" ], "severity": "HIGH", "github_reviewed": true, "github_reviewed_at": "2024-07-22T14:33:41Z" }