Sit down for ten minutes and I will explain one of the least glamorous and most common ways a company’s own domain ends up serving someone else’s content. You do not need to know any exploitation. You only need to understand how DNS and cloud hosting hand things off to each other.
Two systems, one name
Suppose your marketing team wants a campaign page at offers.example.in. They do not host it on your servers. They sign up with a landing-page service or a cloud storage website feature, and that provider says: “Create a CNAME record pointing your subdomain at our hostname.” Someone in IT adds the record. The page goes live, everyone is happy.
Notice what you now have. Your DNS zone says “this name is an alias for something at the provider”. The provider’s own system says “this hostname belongs to customer account 4471, serve their page”. Two separate databases, owned by two separate parties, kept in sync by nothing except people remembering.
What happens when the campaign ends
Three months later the campaign is over. The marketing person cancels the landing-page account, or deletes the storage bucket to stop the bill. Good housekeeping, you would say. But the DNS record is still sitting in your zone, because DNS belongs to a different team and nobody told them.
Now the alias points at a provider hostname that no customer owns. Many providers allow any new customer to claim an unclaimed hostname. If a stranger creates an account and claims that exact name, the provider will happily serve the stranger’s content whenever someone asks for offers.example.in. Your DNS vouches for it. The padlock may even show, depending on how the provider issues certificates. This is a subdomain takeover, and the dangling record is the whole vulnerability.
Not every provider works this way. Some bind a hostname to an account permanently, or require proof of domain ownership before serving. That is why you will hear security people say “it depends on the service”. Your job is not to memorise which providers are affected today (that list changes) but to know the pattern.
Why this is worse than a defaced page
You might shrug: a fake page on a forgotten subdomain, so what? Think about what a browser sees. The content comes from a name that belongs to your registered domain. That has several consequences.
- Phishing becomes far more convincing. A login page at a real subdomain of your bank or employer passes the eyeball test and many URL filters.
- Cookies set for the parent domain may be readable by, or sent to, the hijacked subdomain. If your main application scopes its session cookie to the whole domain rather than one host, the risk grows.
- Some security policies trust sibling subdomains. An allow-list that says “any subdomain of example.in may embed this” now includes the attacker.
- Search engines index the attacker’s content under your domain, so spam or fraudulent pages can damage your reputation.
The same idea applies to other record types too. A dangling record that points to an IP address your company released back to a cloud provider can end up pointing at someone else’s server. Same gap, different shape.
Finding the dangling ones
The detection logic is simple, which is why attackers automate it and why you should too. Export every record in your zones. For each alias, resolve the target. If the target does not resolve, or resolves to a provider’s “no such site” or “bucket not found” page, flag it. Run this regularly, not once, because new dangling records appear every time someone decommissions something.
Two practical gaps show up in real organisations. First, nobody has a complete list of zones, because subsidiaries, old acquisitions and agencies registered domains on their own. Second, DNS access is often held by a network team that never hears about cloud clean-ups. Attack surface discovery tools help with the first; process fixes the second.
Making it stop happening
Fixes are mostly about ordering and ownership.
- Remove the DNS record before deleting the cloud resource. Decommissioning checklists should list DNS as a step, in that order.
- Create the resource first and add the DNS record afterwards when launching, so there is never a window where the name points at nothing.
- Where a provider offers domain verification (a token you place in DNS to prove ownership), use it.
- Keep an owner against every subdomain in a register. A record with no named owner is a candidate for deletion.
- Scope session cookies to the specific host, not the whole parent domain, so a hijacked sibling cannot see them.
Do you see why this is a process problem more than a technical one? Nothing was hacked in the usual sense. Two teams each did something reasonable, in the wrong order, without telling each other. If a colleague asks you what to check during an annual clean-up, “every DNS record that points outside our own network” is a better answer than most scanners will give.
Leave a Reply