Remediating new DNSSEC resource exhaustion vulnerabilities

Two DNSSEC vulnerabilities that place heavy computational demands on validating resolvers were addressed across the DNS industry through a multivendor effort. Cloudflare reports that all of its own DNS infrastructure was protected against both issues before public disclosure, including the public 1.1.1.1 resolver, where mitigations were applied ahead of the disclosure date. Internal resolvers running the open-source unbound software were upgraded promptly once a fixed release appeared. The Authoritative DNS and DNS firewall products are not affected.

Fixes have shipped from all major DNS software vendors, and other major resolver operators have applied their own mitigations. Operators running their own resolvers are urged to update immediately.

Why DNSSEC is exposed to resource exhaustion

DNSSEC extends DNS with authentication and integrity through cryptographic keys and signatures, letting resolvers verify that responses are authentic. Its specifications, however, favor availability at the price of added complexity and computational cost on the validating side. The mitigations for these vulnerabilities amount to local policies that relax those requirements so validators do not run out of resources.

The underlying tension is the Robustness principle baked into DNS design — conservative in what you send, liberal in what you accept. Attackers can exploit protocol requirements that follow this principle by crafting DNSSEC responses with expensive configurations, forcing resolvers to do extra work. Operators are left balancing the flexibility that lets a protocol evolve against the stability and security of live services.

Cloudflare notes that 1.1.1.1 already applies stricter validations and limits than typical, both to protect its own infrastructure and to shield authoritative servers outside its network. This sometimes draws complaints about resolution failures, particularly for improperly configured domains, but the company treats such limits as necessary for overall DNS reliability and resilience.

CVE-2023-50387: key tag collisions in Keytrap

A signed zone may hold multiple DNSKEY records, and a single Resource Record Set may carry multiple RRSIG signatures — a setup needed for key rollover, algorithm rollover and multi-signer DNSSEC. Validating resolvers are required to try every possible key/signature combination.

Pairing signatures to keys relies on the key tag, an unsigned 16-bit checksum over the key's RDATA. Key tags are not unique, so several keys can share one. An attacker can craft a response containing many keys with the same key tag plus many signatures, none of which validate. The resolver must then test the number of keys multiplied by the number of signatures, multiplying computational cost and degrading performance for every user of that resolver. Variants include many signatures against a single key, one signature against multiple colliding keys, and multiple keys whose hashes are added to the parent delegation signer record.

Mitigations applied

  • A cap on the number of keys accepted at a zone cut, the point where a parent zone delegates to a child.
  • A signature-validation limit per RRSET plus a total limit per resolution task, where one task may span several recursive queries to external authoritative servers.
  • Queries that exceed the limits fail to resolve and return an Extended DNS Error (EDE) code 0.
  • New metrics for detecting attacks that attempt to exploit the flaw.

Cloudflare found that the zone-cut key limit alone, even alongside other platform protections, still left processing a malicious answer from an authoritative server too costly.

CVE-2023-50868: NSEC3 iterations and closest encloser proofs

NSEC3 provides authenticated denial of existence using hashes of DNS names rather than the names themselves, aiming to prevent zone enumeration, and it permits multiple hash iterations. Since the full DNS name is the hash input, raising iterations beyond the first adds no value — RFC 9276 recommends against it. The cost compounds when a validator must also find the closest encloser proof. A malicious authoritative response can set a high iteration count and long multi-label names, forcing unnecessary hashing that exhausts the resolver.

Mitigations applied

A total hash-calculation limit per resolution task was added, mirroring the Keytrap approach. Queries over the limit fail and return an EDE code 27, and new metrics track hash calculations so attacks can be detected early.

Timeline

Date and time in UTC

Event

2023-11-03 16:05

John Todd from Quad9 invites Cloudflare to participate in a joint task force to discuss a new DNS vulnerability. 

2023-11-07 14:30

A group of DNS vendors and service providers meet to discuss the vulnerability during IETF 118. Discussions and collaboration continues in a closed chat group hosted at DNS-OARC

2023-12-08 20:20

Cloudflare public resolver 1.1.1.1 is fully patched to mitigate Keytrap vulnerability (CVE-2023-50387)

2024-01-17 22:39

Cloudflare public resolver 1.1.1.1 is fully patched to mitigate NSEC3 iteration count and closest encloser vulnerability (CVE-2023-50868)

2024-02-13 13:04

Unbound package is released 

2024-02-13 23:00

Cloudflare internal CDN resolver is fully patched to mitigate both CVE-2023-50387 and CVE-2023-50868

Credits

The Keytrap vulnerability was discovered and responsibly disclosed by Elias Heftrig, Haya Schulmann, Niklas Vogel and Michael Waidner of the German National Research Center for Applied Cybersecurity (ATHENE). Petr Špaček of Internet Systems Consortium (ISC) discovered and disclosed the NSEC3 iteration and closest encloser proof vulnerability. John Todd of Quad9 and the DNS Operations Analysis and Research Center (DNS-OARC) facilitated coordination among stakeholders, and DNS-OARC community members from DNS vendors and service providers worked to fix both issues.