How DNS Hijacking Lets Attackers Obtain Valid SSL Certificates

How DNS Hijacking Lets Attackers Obtain Valid SSL Certificates

A valid padlock in the browser proves that a certificate authority checked control of a domain at one moment. It does not prove the right people were in control at that moment. For sysadmins, DevOps engineers and security teams, this is what makes DNS hijacking dangerous. An attacker who briefly controls your DNS can get a fully trusted SSL certificate for your domain, and browsers will show no warning. This article explains how the attack works, why HTTPS alone does not stop it, and which controls shorten the window or close it.

Why Domain Validation Trusts Whoever Controls DNS

Every publicly trusted TLS certificate starts with domain validation. A DV certificate relies on it completely, and OV and EV certificates rely on it too. The CA sends a challenge and checks that the requester can answer it from the domain. Under the ACME protocol there are three standard methods. HTTP-01 places a token at a well-known URL. DNS-01 publishes a TXT record under _acme-challenge. TLS-ALPN-01 answers a special TLS handshake on port 443.

All three methods start with a DNS lookup. If an attacker controls the answers to that lookup, the CA ends up validating the attacker’s infrastructure. Nothing in the process asks who owned the domain yesterday. The ACME issuance flow is fast, free and fully automated, so an attacker needs only a few minutes of control. A certificate can be issued in under 60 seconds.

How DNS Hijacking Leads to Valid SSL Certificates

The attack path is usually simple. An attacker takes over the registrar account, the DNS hosting account or an API token for a provider such as Cloudflare, Route 53 or GoDaddy. They change the NS records or add one A record or TXT record. Then they request a certificate from Let’s Encrypt, ZeroSSL or any other ACME CA. Once the certificate is issued, they can quietly revert the DNS change.

The certificate is now valid for its full lifetime, often 90 days. The attacker can use it later together with a smaller interception, such as a poisoned resolver on a hotel network, a compromised router or a short BGP hijack. To the browser the connection looks perfect.

This is not theoretical. The Sea Turtle and DNSpionage campaigns that Cisco Talos documented in 2018-2019 changed DNS records at registrars and registries, then obtained Let’s Encrypt certificates to intercept credentials for government and telecom targets. In February 2022, attackers behind the KLAYswap incident in South Korea hijacked a BGP prefix that served a JavaScript dependency. They obtained a valid certificate for the hijacked hostname and used it to serve malicious code. Routing attacks and DNS attacks reach the same weak point: the CA’s view of the network.

Myth: HTTPS Protects You Even If DNS Is Compromised

This is the most common misconception about the topic. The reasoning sounds sound: “Even if someone redirects our DNS, they can’t fake our certificate, so users will see a warning.” That was mostly true when certificates cost $200 and needed manual checks. It has not been true since automated free issuance became the norm.

The attacker does not fake your certificate. They get their own, and it is just as valid. HSTS does not help in this case either. HSTS forces HTTPS, and the attacker is serving HTTPS. TLS authenticates the domain name, not the organization behind it. If control of the name is lost, the authentication goes with it.

A related myth is that DNSSEC solves the problem. DNSSEC protects against forged responses in transit. It does not help when the attacker is logged into your registrar account and changes the nameservers and DS records through the legitimate interface.

Controls That Prevent Unauthorized Issuance

An experienced security engineer layers controls so that a single compromised password cannot lead to a certificate. In rough order of impact, the most useful steps are:

1. Registrar and registry lock. Enable registry lock (serverUpdateProhibited and related statuses) where your TLD supports it. With registry lock, NS changes need an out-of-band confirmation, often a phone call. Most .com registrars offer it for $50-300 per year.
2. Hardened accounts. Use hardware-key MFA (FIDO2) on registrar and DNS provider accounts. Scope API tokens to individual zones, and rotate any token stored in CI systems.
3. CAA records. Publish CAA records (RFC 8659) that list only the CAAs you actually use. Add the accounturi and validationmethods parameters from RFC 8657 so Let’s Encrypt only issues to your specific ACME account, for example by allowing dns-01 alone.
4. Certificate Transparency monitoring. Watch CT logs for every new certificate on your domains and subdomains.
5. Revocation playbook. Document how to get a certificate revoked by each CA you use, and keep proof-of-ownership material ready.

CAA has a known limit: an attacker who controls DNS can also rewrite the CAA records. CAA is still worth having, because it blocks attackers who only control one subdomain record or a web server and do not have full zone access.

Multi-perspective validation also raises the cost of the attack. Since CA/Browser Forum Ballot SC-067, publicly trusted CAs have had to phase in multi-perspective issuance corroboration (MPIC), beginning in March 2025. They validate from several network locations, which makes localized BGP and resolver hijacks much harder. MPIC does nothing against a registrar compromise, because in that case every vantage point sees the same malicious records.

Detecting a Rogue Certificate After Issuance

All publicly trusted certificates must be logged in Certificate Transparency, so an unauthorized certificate leaves a public trace. Monitoring Certificate Transparency through crt.sh, Cert Spotter or a dedicated SSL monitoring service shows a new certificate within minutes to hours of issuance.

An SRE investigating an alert starts by asking three questions. Does the issuing CA match the CAs we use? Does the requesting account or the validation timing match our automation’s schedule? Was there a matching DNS change in the provider’s audit log? A sudden change in certificate issuer is often the first clear signal. One example is a Sectigo-issued certificate appearing for a domain that has used only Let’s Encrypt for three years.

Here is a realistic timeline. At 02:10 a leaked Cloudflare API token is used to add a TXT record. At 02:11 a certificate is issued. At 02:14 the record is deleted. A team that reviews DNS changes weekly finds out six days later. A team with CT alerts routed to on-call can contact the CA’s revocation channel before 03:00 and rotate the token right away.

Common Mistakes Teams Make

The first mistake is treating registrar credentials as a finance or marketing asset. The account is often registered to someone’s personal email, it has no MFA, and it is shared through a spreadsheet. That account controls every certificate the company can obtain.

The second is filtering CT alerts down to “certificates from unexpected CAs” only. An attacker can request a certificate from the same free CA you use. Alert on every new certificate, and suppress only the ones you can match to a known automation run.

The third is assuming revocation fixes everything. Browser revocation checking is inconsistent. Chrome relies on CRLSets, and Let’s Encrypt ended its OCSP service in 2025 in favour of CRLs. A revoked certificate can keep working against some clients until it expires. Shorter lifetimes, moving toward 47 days under the CA/B Forum schedule, limit that window more reliably than revocation does.

FAQ

Can an attacker get an EV or OV certificate through DNS hijacking?
It is much harder. OV and EV vetting checks organization records and usually includes a callback, so a DNS hijack alone rarely succeeds. Browsers no longer display EV differently, though, so a DV certificate gives the attacker the same padlock.

Does DNSSEC prevent attackers from getting certificates for my domain?
It prevents spoofed responses on the network path, and CAs validate DNSSEC when it is present. It does not stop an attacker who changes records through your compromised registrar or DNS provider account.

How quickly should I respond to an unexpected certificate in CT logs?
Treat it as a security incident. Within the first hour, confirm whether your automation issued it, check the DNS audit logs, rotate any exposed credentials and request revocation from the issuing CA.

Summary: Protect the Name, Watch the Logs

DNS hijacking works because domain validation trusts whoever answers for the domain at that moment. HTTPS, HSTS and DNSSEC do not change that once the account itself is compromised. The controls that work are registry lock, hardware-key MFA on registrar and DNS accounts, CAA records restricted to specific ACME accounts, and continuous Certificate Transparency monitoring with alerts that reach someone who can act. If you do only one thing this quarter, enable MFA and registry lock on your registrar account, because every certificate for the domain depends on it.