A simple diagram of the Subdomain Takeover risk path
Risk path: an input or context crosses a security boundary.
A simple three-step test path for Subdomain Takeover
Testing path: establish a baseline, make one controlled change, and verify the effect.

01Issue

Overview

A DNS record can point a subdomain to a service hosted by another provider. If the organization deletes the hosted project but leaves the DNS record, the hostname may point to a resource that no longer exists. A takeover is possible only when the provider allows a different customer to claim the same resource name or bind the organization’s hostname. A dangling record is a signal to investigate, not proof of claimability.

Common causes

  • A cloud site, storage bucket, or application is deleted while its DNS record remains.
  • Teams remove hosted resources without checking which names still point to them.
  • No inventory links each external DNS record to a current owner and resource.
  • Provider error messages are treated as proof without checking the provider’s actual claim rules.

References: Microsoft: Prevent Dangling DNS and Subdomain Takeover ↗OWASP WSTG: Information Gathering ↗

02Examples

EXAMPLE

Illustrative DNS result: legacy.example.test CNAME old-project.hosting.example. A provider’s “site not found” page shows that the configured target is not serving the expected site, but it does not prove another account can claim it. Confirm the exact resource status and claim policy in the organization’s provider account or documentation.

03Impact

The organization’s DNS must point to an unclaimed external resource, and the provider must allow an unrelated account to claim that resource or bind the same hostname. Ownership and provider behavior must be verified before classifying it as a takeover.

If claimability is confirmed, another party may serve content under the organization’s subdomain or receive traffic intended for it. Whether this affects cookies, trust, or other systems depends on the domain configuration and application behavior; those impacts require separate evidence.

04Testing

Test cases

1. Check whether an abandoned service can be claimed

Find a subdomain pointing to an unassigned service and review the provider’s current ownership and claim rules. Confirm the condition without claiming a resource belonging to another party.

Example: An unassigned-service message is a lead. It is not proof that a new account can attach that domain.

GET / HTTP/1.1
Host: unused.example.test

2. Compare DNS records with service ownership

Inspect DNS targets, provider errors, and the organization’s service inventory. Identify whether the referenced resource is still allocated and controls the hostname.

Example: A CNAME pointing to a cloud provider is common. It becomes relevant when the target is unassigned and claimable.

GET / HTTP/1.1
Host: old-app.example.test

3. Assess the domain’s trust relationships

Review cookies, links, CORS trust, and redirects that depend on the subdomain. State only the consequences supported by a confirmed ownership issue.

Example: A dangling DNS entry alone does not establish session access. Its impact depends on actual trust and browser rules.

Testing references: Microsoft: Prevent Dangling DNS and Subdomain Takeover ↗OWASP WSTG: Information Gathering ↗

05Mitigation

Remove stale DNS records promptly and maintain an inventory that ties each external record to a current resource owner. When retiring a hosted service, coordinate DNS removal and resource deletion. Automate checks for dangling targets and alert the responsible team before a resource can be claimed by another account.

Retest

Recheck authoritative DNS and provider ownership after cleanup. Confirm the retired name no longer points to the provider resource and that active names still resolve to organization-controlled services.