Marketing spins up a campaign site on a hosting platform and points promo.yourcompany.com at it. The campaign ends. The hosting account is deleted. The DNS record is not.
That record now points at a name on a provider where anybody can claim an unused name. Whoever claims it serves whatever they like at promo.yourcompany.com, with a valid certificate, from your domain.
What makes it possible
A CNAME delegates a name to a provider. Providers allocate names on a first-come basis. When you release your resource, the name returns to the pool while your CNAME keeps pointing at it.
The vulnerable pattern is always the same: your DNS record resolves, the target no longer belongs to you, and the provider lets a new account claim it. Platform hosting, object storage, documentation and support tools, status pages, email and marketing platforms have all been affected at various times.
Why it is worse than it sounds
This is not a defacement of an unused page.
- Cookies. Cookies scoped to
.yourcompany.comare sent to every subdomain, including the hijacked one. Session tokens scoped this way are readable by the attacker. - Phishing with a genuine domain. The page is on your real domain with a valid certificate. Nothing a user can check will look wrong, and awareness training specifically teaches people to check exactly that.
- Trusted origins. Content security policies and CORS configurations that allow
*.yourcompany.comnow trust attacker content. - Reputation. Your domain starts serving malware or scam content and gets listed by blocklists, affecting the main site and email delivery.
Finding them
The method is straightforward: enumerate your subdomains, resolve each, and look for records that resolve to a provider but return a provider error page rather than your content.
- Pull subdomains from your own DNS zones, certificate transparency logs and passive DNS sources. Certificate transparency is particularly useful because any certificate ever issued for a name appears in it.
- Resolve each one and note the CNAME target.
- Request each and look for the characteristic "no such app" or "bucket does not exist" responses.
- Verify before reporting. Some provider error pages look alarming and are not actually claimable.
Open-source tooling automates all of this, which is precisely why attackers scan for it continuously. Assume your domain is being checked regularly.
Fixing and preventing
The fix is almost always to delete the record. If the subdomain is still needed, reclaim the name on the provider first.
Prevention is process rather than technology:
- Decommissioning must include DNS. Most takeovers trace back to a checklist that covered the application and not the record pointing at it.
- Record an owner and purpose for every entry. Records nobody can explain are the ones that get abandoned.
- Review the zone periodically and resolve everything in it.
- Scope cookies narrowly. Avoid domain-wide cookies so a hijacked subdomain cannot read sessions.
- Avoid wildcard trust in content security policies and CORS configuration.
- Publish a security contact so researchers who find one can tell you quickly.
Wildcards cut both ways
A wildcard DNS record means every possible subdomain resolves, which prevents this specific issue and creates others — any name resolves, so phishing with an arbitrary subdomain of your domain becomes trivial and enumeration becomes meaningless.
Prefer explicit records with an owner recorded against each.
0 comments
Leave a comment