DNS Hijacking: When the Attacker Can Change the Record
Security
In January 2019 the United States gave its federal agencies ten business days and four things to do about their own domain names. The order came out during a live campaign against them, which is what makes the list worth reading closely. Something written in those conditions has to name what was actually going wrong, so four required actions amount to a description of the attack that produced them.
Four required actions, read backwards
The order is Emergency Directive 19-01, issued by the United States Cybersecurity and Infrastructure Security Agency on 22 January 2019 under the title Mitigate DNS Infrastructure Tampering. Agencies had four things to do within ten business days: audit their records, change the passwords on the accounts that can edit those records, add multi-factor authentication to those same accounts, and watch for certificates issued in their names. Which kinds of second factor are worth having, and which are weaker than they look, is how those factors are graded against each other.
Read in that order, the list is housekeeping. Taken backwards, it is a chain.
The way in is an account rather than a protocol. The directive describes the sequence it was written against, and the first step touches no name server at all: “The attacker begins by compromising user credentials, or obtaining them through alternate means, of an account that can make changes to DNS records.” A footnote names where such an account can live, and there are four kinds: an organisation’s own server software, the systems that manage that software, a third-party operator’s administration panel, and the registrar account itself.
Step two uses the account exactly as an authorised user would. The attacker alters records, “replacing the legitimate address of a service with an address the attacker controls”. Nothing in that step is broken or bypassed. The records are edited by somebody holding the authority to edit them, and the servers below publish the new values as readily as they would publish a correction from the owner.
One sentence in that passage is easy to read past, and it outlasts the incident: “This creates a risk that persists beyond the period of traffic redirection.” Traffic went somewhere for a while. Whatever was collected while it was there does not come back when the record is put right.
A certificate that passes the check
The third step in the sequence is the one that makes the first two hard to notice. Because the attacker can set the record values, the directive says, “they can also obtain valid encryption certificates” for the names involved. The consequence arrives in the next sentence, without hedging: “Since the certificate is valid for the domain, end users receive no error warnings.”
That is why the fourth action exists. The remedy the directive reached for was a feed: the agency undertook to deliver newly added entries from Certificate Transparency logs for the domains concerned, and agencies were to begin “monitoring CT log data for certificates issued that they did not request”. Only the party that publishes a name can tell a request of its own from somebody else’s, which is what that action turns on: “Data from Certificate Transparency logs can alert you that a certificate was issued for a domain you manage.”
Notice who is addressed by all four of those actions: the agency, the account holder, whoever can sign in and look. None of them is addressed to a person visiting the service, because by the time the redirection is running, nothing at a visitor’s end raises a warning.
Trust arrives with the configuration
A change made where records are published is one way the answer you get can be somebody else’s choice. Another was described in 2004, in an analysis of the threats the IETF wanted its DNS security work to cover. That document is Informational and says as much: it “does not specify an Internet standard of any kind.”
Its fourth threat carries the bluntest name on the list, betrayal by trusted server, and it opens on “the trusted server that turns out not to be so trustworthy, whether by accident or by intent”. The arrangement it relies on is the ordinary one. “Many client machines are only configured with stub resolvers, and use trusted servers to perform all of their DNS queries on their behalf.” Where that server came from is a matter of configuration rather than choice: “In many cases the trusted server is furnished by the user’s ISP and advertised to the client via DHCP or PPP options.”
Hostility is not required for this to bite. The same passage allows that “the server itself may be configured to give back answers that are not what the user would expect, whether in an honest attempt to help the user or to promote some other goal such as furthering a business partnership between the ISP and some third party.”
Then comes the sentence that locates the whole problem. “Viewed strictly from the DNS protocol standpoint, the only difference between this sort of betrayal and a packet interception attack is that in this case the client has voluntarily sent its request to the attacker.”
Its authors are not optimistic about the obvious remedy either, observing that “In many network environments a client machine has only a limited set of recursive name servers from which to choose, and none of them may be particularly trustworthy.” The case for making that choice deliberately anyway, and the limits on what it buys, belongs to choosing that server on purpose.
Forging an answer is a separate problem
Both cases above involve somebody who is permitted to answer, and a third does not.
A Standards Track document from January 2009, on measures for making the Domain Name System more resilient against forged answers, states the acceptance rule in full. “DNS data is to be accepted by a resolver if and only if” four conditions hold: the reply answers a question currently waiting for a response, its ID field matches the one that was sent, and it arrives from, and at, the address and port that question used. Then the line that turns a specification into an opportunity: “In general, the first response matching these four conditions is accepted.”
First, not best. That document states the consequence plainly: “If a third party succeeds in meeting the four conditions before the response from the authentic nameserver does so, it is in a position to feed a resolver fabricated data.” The damage is not confined to the one visitor who triggered it, because a resolver keeps what it accepts. “Once spoofed, a caching server will repeat the data it wrongfully accepted, and make its clients contact the wrong, and possibly malicious, servers.”
The 2004 analysis files this family under name chaining, and points at the record types that make the best lever, because what sits on their right is another name: “The worst examples in this class of RRs are CNAME, NS, and DNAME RRs because they can redirect a victim’s query to a location of the attacker’s choosing.” Those three are the types such an attack reaches for, and what each of them carries is in a record whose value is itself a name.
What can be checked from where you sit
The directive’s first action is the one a reader can copy, and its wording is modest about the result. Agencies were to “audit public DNS records on all authoritative and secondary DNS servers to verify they resolve to the intended location”. A question in the directive’s own notes narrows that further, and the narrowing is the useful part: the audit “is an action to stop any current hijacking from occurring, not a requirement to check available DNS or system logs in an effort to evaluate whether a hijack has ever occurred”. It answers what is happening now. Last year is a different exercise.
For a name you do not control, the nearest equivalent is asking what the address it answers with actually is. Registry records describe the block that address was allocated from and name the party to write to about it, which makes which network holds it, and who takes the complaint a different question from who edited the record. Those records can tell you whose space a service has moved into. They cannot tell you that it moved.
Reputation data is indexed the same way, by address. The signals a site consults before you reach a login describe an address and its history, which is why what reputation databases say about a single address reports on the connection you are using rather than on any name you typed. A redirection changes the mapping between a name and an address, and a judgement about an address cannot see that change.
The directive closed on 8 January 2026, when the agency recorded that its purposes had been met and withdrew the mandated actions with it. Nothing in the first two steps of that campaign required a flaw in the protocol. Two of the four things the order asked for concerned who may sign in and edit a record, and the other two were ways of finding out whether somebody already had.