KeyTrap turns a single DNS answer into an enormous amount of cryptographic work for the DNSSEC-validating resolver that receives it, with no traffic volume involved. It is a denial-of-service attack on DNS resolvers, tracked as CVE-2023-50387 and disclosed in February 2024 by the ATHENE research centre, and a resolver weakness that belongs in the scope of a DDoS test, flood or no flood. The researchers reported that a single crafted response stalled resolvers for between about 1 minute and 16 hours, depending on the software.
How KeyTrap works
DNSSEC lets a resolver check that an answer was signed by the zone's key. Each signature carries a short key tag that says which key made it, and the tag is not unique: several keys can share one.
The standards tell validators to be forgiving. If a signature does not verify with one candidate key, try the next, and if one signature fails, try another. The aim was to keep validation working through key rollovers and other ordinary mistakes.
KeyTrap is what that forgiveness costs when the zone is hostile. The attacker runs the authoritative server for a domain of its own, publishes many keys that share tags and many signatures that never verify, and gets a resolver to ask about a name in it. The validator then checks every key against every signature. Signature checks are expensive, and the number of combinations grows as keys times signatures, so one response becomes a huge amount of work.
Nothing in the packet is malformed. Every record is valid DNSSEC syntax, which is why parsers and firewalls pass it untouched.
Why it matters under attack
One packet does the work of a flood. A DNS flood needs volume, and a cache-defeating variant such as NXNSAttack needs many queries amplified. KeyTrap needs one question about the attacker's domain, repeated now and then to keep the resolver busy. Volumetric defences never see it.
The victim is everyone behind the resolver. While validation threads are busy, cached answers may still flow, but every new lookup waits. For an organisation running its own validating resolvers, that means internal services, outbound API calls and email delivery all stall together.
The fault is in the design, not one product. Resolver software has been patched to cap how much validation work one answer may cause. The root cause, a protocol that asks validators to keep trying, needs a change to the standard itself, so the limits are a mitigation rather than a cure.
Hardening, and what a DDoS test measures
Patch every validating resolver you run, including the ones nobody thinks of: resolvers inside appliances, container clusters and branch offices. An unpatched validator reachable by any client that can make it look up an arbitrary name is the exposure.
Know which resolvers your services depend on. Many applications use a cloud provider's or a public resolver, and the question there is what your service does when lookups stop answering for minutes: does it keep serving from cache, retry sensibly, or fail every request that needs a fresh name?
A test does not reproduce KeyTrap against anyone's production resolver. In an authorised staging copy, it confirms that the resolver version enforces a validation-work limit, and it measures the second question directly: hold resolution unavailable for a set period and record which service fails first and how long it takes to come back once answers return.
How to test authoritative and recursive DNS separately, including the self-inflicted DNSSEC failures that need no attacker at all, is covered in DNS DDoS testing.