Dangling DNS Records Expose Companies to Subdomain Takeovers Years After Projects Shut Down

A marketing team requested reactivation of a three-year-old promotional landing page, only to discover that its domain now served an unrelated third-party website. The root cause was a forgotten CNAME record in the company's DNS zone that continued pointing to a project name on external hosting after the original service had been decommissioned. Because many hosting providers use wildcard DNS entries, standard availability checks and simple DNS resolution tests fail to detect that the target project no longer exists. Attackers who re-register the freed project name can then serve content under the company's legitimate subdomain, automatically obtaining valid TLS certificates and inheriting domain-wide cookies. The article details how such dangling records accumulate across infrastructure, marketing, and acquired company zones, and explains the concrete risks including cookie theft, bypass of Content-Security-Policy, and unauthorized domain ownership proofs. It concludes with a practical remediation workflow: export the full zone, assign owners to every record, validate external targets by application response rather than DNS resolution, and embed record removal into decommissioning procedures.

HabrTranslated from Russian

Read at source

A marketing request to restore a promotional landing page from three years ago revealed a serious but common DNS hygiene problem. The team opened the original URL and encountered a completely unrelated website, even though the browser displayed the company's own domain name and a valid TLS padlock.

The original page had been hosted on external infrastructure using a project-specific name such as company-promo-2023. A CNAME record was created in the corporate DNS zone to map the promotional subdomain to that external address. When the campaign ended, the hosting project was deleted, yet the DNS record was never removed.

How dangling records form

External hosting platforms assign project names on a first-come, first-served basis. Once the original project is deleted, the name becomes available for anyone to register. Because the corporate CNAME still exists, any new registrant instantly receives traffic intended for the company's subdomain and obtains an automatically issued TLS certificate.

Standard monitoring misses these records. Availability checks only test known applications, and DNS resolvers return addresses even for non-existent projects when the hosting provider uses a wildcard record such as *.github.io.

Security impact

  • Cookies set for the parent domain (for example, .example.com) are sent to any subdomain, allowing the new owner to receive session tokens.
  • Subdomains often remain in Content-Security-Policy, CORS headers, OAuth redirect lists, and proxy rules long after the original service is gone.
  • Attackers can complete domain-ownership challenges that rely on placing a file on the host.

The recommended cleanup process begins with exporting the entire zone from every DNS provider, assigning explicit owners and business justifications to each record, and validating external CNAME targets by checking the actual HTTP response rather than DNS resolution alone. Records whose owners cannot be identified are treated as candidates for immediate deletion.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Vulnerabilities & Exploits

Telegram for Android Patches Voice Call Vulnerability Enabling Code Execution
Yandex Patches Millions of Stations After eMudhra Certificate Keys Compromised
Cisco ASA and FTD Face DoS Vulnerability in SSL VPN Already Exploited in the Wild