Skip to main content
HighDNSOWASP A05:2021CWE-350

How to fix: Dangling CNAME (CDN/PaaS Takeover)

A CNAME points to GitHub Pages (github.io), Heroku (herokuapp.com), AWS CloudFront, Azure CDN (azurewebsites.net/azureedge.net), Fastly, or Netlify, and the target no longer resolves. Attackers can register the orphan resource and serve content from your subdomain.

Why it matters

Subdomain takeover via CDN/PaaS enables phishing using your domain name, cookie theft for cookies scoped to the parent domain, bypass of CSP using your origin, and Content Security Policy violations.

When you remove a CDN resource (delete a Heroku app, unpublish a GitHub Pages site, remove a CloudFront distribution) without removing the DNS CNAME record, the record still points at a now-unclaimed namespace. Anyone who registers a new resource at that provider can then claim your subdomain.

How to fix it

  1. 1Audit all CNAMEs targeting GitHub, Heroku, AWS, Azure, Fastly, and Netlify.
  2. 2Remove CNAMEs whose backing service no longer resolves.
  3. 3Verify takeover feasibility at https://github.com/EdOverflow/can-i-take-over-xyz

Code examples

Check CNAME targets

bash
dig +short CNAME staging.example.com
# If it returns e.g. myapp.herokuapp.com., verify the app exists:
curl -I https://myapp.herokuapp.com/

References

Detected automatically by VulnRadar. The check id is dns-dangling-cname-cdn-paas, stable across every scan so you can filter or diff on it.

See every dns check

Questions

How severe is Dangling CNAME (CDN/PaaS Takeover)?
VulnRadar rates this high severity in the dns category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id dns-dangling-cname-cdn-paas, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Dangling CNAME (CDN/PaaS Takeover) map to?
It maps to CWE-350. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for dangling cname (cdn/paas takeover)

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Dangling CNAME (CDN/PaaS Takeover) | VulnRadar