Skip to content
Subdomain takeover Write-up Beginner

Catching a Dangling CNAME: How an Unclaimed Squarespace Subdomain Leads to Takeover

A subdomain had a dangling CNAME record pointing to Squarespace, but the hostname was not claimed on the platform. An attacker could register that hostname on Squarespace and serve arbitrary content from the trusted subdomain.

Hassan Follow

Published on itshassan74.medium.com

Bug Bounty

Hassan, on itshassan74.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Subdomain takeover happens when a DNS record for a hostname under a domain you control points at a third-party service, and the resource that record was meant to reach no longer exists or was never bound. The DNS entry stays valid, so the name still resolves, but the service on the other end has no customer mapped to it. Whoever claims that hostname on the provider first gets to serve content under your brand.

This write-up covers one instance of that pattern. During recon, Hassan found a subdomain of a target, referred to throughout as subdomain.target.com, whose CNAME pointed at Squarespace's customer hosting endpoint, ext-cust.squarespace.com. On the Squarespace side the hostname was not claimed, so the subdomain was effectively free for anyone to register on the platform.

Setup

The work needed nothing beyond command-line tooling: dig for the DNS lookup and curl for the HTTP probes. No account on the target was required to find the issue, and the report does not describe creating a Squarespace account to complete the claim, only the steps one would follow to verify it. The precondition is simply a subdomain that resolves through a CNAME to a third-party provider where the corresponding site or custom domain binding is absent.

Finding it

The starting point was a DNS query against the subdomain to see where it routed. The answer was a CNAME to ext-cust.squarespace.com, which is the endpoint Squarespace uses for customer-hosted domains. A CNAME to a provider is not a problem by itself; it becomes one when the provider has no record of the hostname on its side. The next two probes were there to establish exactly that.

Exploitation

Step 1: Check the DNS records

Bash
dig +noall +answer subdomain.target.com CNAME

+noall +answer suppresses everything except the answer section, so the output is just the record being asked about. The result pointed straight to ext-cust.squarespace.com, confirming the subdomain is delegated to Squarespace rather than served by the target's own infrastructure.

Step 2: Probe the endpoint

Bash
curl -skI https://subdomain.target.com/

-s silences the progress meter, -k skips certificate verification and -I fetches headers only. The response was a 404 carrying server: Squarespace. A 404 from the provider, rather than a page from the target, is the first sign that the hostname is not bound to a live site on the platform.

Step 3: Grab the response body

The headers alone do not say why the request failed, so the next step pulled the page and searched it for platform-specific markers:

Bash
curl -skL https://subdomain.target.com/ -o response.htmlgrep -Ei 'Domain Not Claimed|Domain connection in progress|domainName' response.html

Here -L follows redirects and -o response.html writes the body to a file, which grep -Ei then scans case-insensitively for three strings: Domain Not Claimed, Domain connection in progress and domainName. The output contained strings such as "domainName":"subdomain.target.com" and Squarespace - Domain Not Claimed, which is the provider stating that no customer has claimed this hostname. That is the condition that makes the subdomain claimable by anyone.

Step 4: The proof-of-concept sequence

The report lays out the general procedure as three steps:

  1. Spot a subdomain pointing to a third-party service provider via CNAME where the target resource no longer exists or was never bound.
  2. Hit the endpoint with curl or a browser to look for platform-specific error markers (like "Domain Not Claimed").
  3. Create an account on the third-party service and try adding the target subdomain as a custom domain to verify if it binds successfully.

The third step is the confirmation: if the provider accepts the hostname as a custom domain for a new account, the takeover is real. The report describes this as the verification path rather than reporting the outcome of a completed claim.

Root cause

The DNS zone still contained a CNAME for subdomain.target.com pointing at ext-cust.squarespace.com, but no Squarespace site was bound to that hostname. The provider's own response says so: Squarespace - Domain Not Claimed. Because Squarespace lets a customer attach an arbitrary custom domain to an account, and the hostname was unclaimed, the first person to add it would own the binding. The DNS record, which the target still controls, would then resolve visitors to content served by that person.

Nothing in the DNS layer prevents this. A CNAME is a delegation, and once it is in place the target's control over what answers for that name is limited to removing the record. The report does not describe any monitoring or validation that would have caught the stale entry.

Impact

If an external party claimed the hostname before the domain owner noticed, they could host arbitrary content at https://subdomain.target.com/. The report lists three consequences:

  • Running phishing scams or malicious campaigns behind a legitimate, trusted brand subdomain.
  • Bypassing corporate allowlists, security filters or WAF rules that automatically trust anything matching *.target.com.
  • General brand damage and loss of user trust.

The second point is the one that makes this more than a cosmetic issue: filters and allowlists that trust the parent domain by pattern will treat the hijacked host as trusted, so links and payloads served from it inherit that trust. The impact is conditional on someone claiming the hostname first, which the unclaimed state would theoretically allow.

Fix

The report gives two levels of remediation:

  • Quick fix: drop the dangling CNAME record from the DNS zone if the campaign or page is dead.
  • Long term: set up automated DNS monitoring to catch stale CNAMEs pointing to third-party cloud providers or SaaS platforms before someone else does.

The first removes the delegation and with it the attack surface. The second addresses the class of problem, since a single cleanup does nothing for the next subdomain that is retired without its DNS entry being removed.

Variants to test

The same pattern applies to any provider that lets customers bind custom domains, and the detection method generalises:

  1. Enumerate CNAMEs to third-party providers. Query each subdomain's CNAME and look for provider endpoints such as ext-cust.squarespace.com. A positive result is a CNAME to a hosting or SaaS provider rather than to infrastructure the target operates.
  2. Probe for provider error markers. Request the hostname and inspect the body for strings like Domain Not Claimed or Domain connection in progress. A positive result is a provider-specific message indicating the hostname is unbound, rather than a generic 404 from the target's own stack.
  3. Check the server header. A response from the provider, such as server: Squarespace, on a hostname under the target's domain confirms the delegation is live and the provider is answering.
  4. Confirm the binding. Create an account on the provider and attempt to add the hostname as a custom domain. A positive result is the provider accepting the hostname, which verifies the takeover is possible.

Each variant is the same three-part condition: a live CNAME to a provider, an unclaimed hostname on that provider, and a provider that allows arbitrary custom domain binding.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A company owns a domain name, something like target.com. Under that domain it has many subdomains, such as shop.target.com or blog.target.com. A subdomain is simply a name that sits in front of the main domain, like a room number in front of a building address.

One of those subdomains, called subdomain.target.com throughout this article, was set up to point at a website hosting company called Squarespace. The company did not host the page itself; it told the internet "for this name, go and ask Squarespace". That instruction is called a CNAME record, and it lives in the domain's DNS settings.

The problem: on the Squarespace side, nobody had actually claimed that name. Squarespace was answering requests for it, but it had no customer attached to it. Squarespace lets any customer attach a custom domain name to their account. So the first person to walk up and add subdomain.target.com to their own Squarespace account would get to serve their own pages at that address, under the real company's brand.

This kind of mistake is called a subdomain takeover. The name still works, the DNS record is still valid, but the thing at the other end is missing, and someone else can fill the gap.

Hassan found this during reconnaissance (recon), which is the information-gathering phase of security testing: looking at what a company exposes to the internet before trying anything clever. The whole discovery needed only two command-line tools, dig and curl, and no account on the target at all.

The idea behind it

Think of DNS as the internet's phone book. You type a name, the phone book translates it into an address, and your browser connects there. A CNAME record is a special phone book entry that says "don't look here, look at this other name instead". It is a forwarding instruction.

Forwarding to a hosting provider is completely normal. Millions of websites do it. It only becomes dangerous when the provider has no record of your name on its side. The forwarding instruction still exists, visitors still arrive at the provider, but the provider has no page to show them and no owner to check with. Whoever registers that name with the provider first becomes the owner.

A useful comparison: you cancel your lease on an office, but you leave the sign with the address on the street corner. People keep walking to that address. If the building manager will hand the keys to anyone who asks for that suite number, the next person through the door gets your visitors.

Setup

The work needed nothing beyond command-line tooling: dig for the DNS lookup and curl for the HTTP probes. No account on the target was required to find the issue. The report describes creating a Squarespace account only as the step one would follow to verify the claim, not as something that was carried out and reported.

The precondition is simply a subdomain that resolves through a CNAME to a third-party provider where the corresponding site or custom domain binding is absent.

Two terms to unpack before we start:

  • Command line: a text window where you type instructions instead of clicking. On macOS and Linux it is called Terminal; on Windows it is Command Prompt or PowerShell.
  • HTTP: the language browsers and servers use to talk. Every time you load a page, your browser sends an HTTP request and the server sends back an HTTP response with a status code, headers and usually a body (the page itself).

Finding it

The starting point was a DNS query against the subdomain to see where it routed. The answer was a CNAME to ext-cust.squarespace.com, which is the endpoint Squarespace uses for customer-hosted domains. A CNAME to a provider is not a problem by itself; it becomes one when the provider has no record of the hostname on its side. The next two probes were there to establish exactly that.

Step 1: Check the DNS records

Bash
dig +noall +answer subdomain.target.com CNAME

Line by line:

  • dig is a small program that asks DNS servers questions. It is the command-line equivalent of the phone book lookup your browser does silently.
  • +noall +answer tells dig to hide everything except the answer section. By default dig prints a lot of extra detail (which server answered, how long it took, and so on); this trims it to just the record.
  • subdomain.target.com is the name being asked about.
  • CNAME says which type of record we want. DNS has many record types; CNAME is the forwarding one.

Why this step: before anything else, you need to know who actually answers for the name. If the answer had been an address owned by the target company, there would be nothing to take over. The result pointed straight to ext-cust.squarespace.com, confirming the subdomain is delegated to Squarespace rather than served by the target's own infrastructure.

Step 2: Probe the endpoint

Bash
curl -skI https://subdomain.target.com/

Line by line:

  • curl is a command-line browser. It fetches a URL and prints what comes back, without drawing a page.
  • -s means silent: it hides the progress meter that curl normally shows while downloading.
  • -k means insecure: it skips checking the site's TLS certificate. Certificates are the padlock in your browser; -k tells curl not to complain if the padlock is broken or mismatched, which is common on misconfigured hostnames.
  • -I means headers only. Instead of downloading the whole page, curl asks the server for just the response headers, the short block of metadata that comes before the body.
  • https://subdomain.target.com/ is the address being requested.

The response was a 404 carrying server: Squarespace.

What those mean:

  • 404 is the HTTP status code for "not found". The server is reachable and understood the request, but has nothing at that address.
  • server: Squarespace is a response header naming the software that answered. It tells you the reply came from Squarespace, not from the target company's own web servers.

Why this step: a 404 from the provider, rather than a page from the target, is the first sign that the hostname is not bound to a live site on the platform. If the target's own server had answered, the story would end here.

Step 3: Grab the response body

The headers alone do not say why the request failed, so the next step pulled the page and searched it for platform-specific markers:

Bash
curl -skL https://subdomain.target.com/ -o response.htmlgrep -Ei 'Domain Not Claimed|Domain connection in progress|domainName' response.html

Line by line:

  • curl -skL https://subdomain.target.com/ fetches the page. -s and -k mean the same as before. -L is new: it means follow redirects. If the server answers "the page has moved, look over there", curl goes there automatically, the way a browser does.
  • -o response.html writes the downloaded page into a file called response.html instead of printing it on screen.
  • grep is a search tool for text. It reads a file and prints only the lines that match a pattern.
  • -E means extended regular expressions, which lets the pattern use | to mean "or".
  • -i means ignore case, so Domain Not Claimed and domain not claimed both match.
  • 'Domain Not Claimed|Domain connection in progress|domainName' is the pattern: find any line containing one of these three strings.
  • response.html is the file being searched.

Why this step: a 404 tells you something is missing, but not what. Squarespace writes specific messages into its error pages when a hostname is not attached to any account. Searching for those messages turns a vague "not found" into a clear statement from the provider about the state of the name.

The output contained strings such as "domainName":"subdomain.target.com" and Squarespace - Domain Not Claimed, which is the provider stating that no customer has claimed this hostname. That is the condition that makes the subdomain claimable by anyone.

Step 4: The proof-of-concept sequence

A proof of concept (PoC) is a small, safe demonstration that a suspected problem is real, rather than a theory. The report lays out the general procedure as three steps:

  1. Spot a subdomain pointing to a third-party service provider via CNAME where the target resource no longer exists or was never bound.
  2. Hit the endpoint with curl or a browser to look for platform-specific error markers (like "Domain Not Claimed").
  3. Create an account on the third-party service and try adding the target subdomain as a custom domain to verify if it binds successfully.

The third step is the confirmation: if the provider accepts the hostname as a custom domain for a new account, the takeover is real. The report describes this as the verification path rather than reporting the outcome of a completed claim.

Root cause

The DNS zone still contained a CNAME for subdomain.target.com pointing at ext-cust.squarespace.com, but no Squarespace site was bound to that hostname. The provider's own response says so: Squarespace - Domain Not Claimed. Because Squarespace lets a customer attach an arbitrary custom domain to an account, and the hostname was unclaimed, the first person to add it would own the binding. The DNS record, which the target still controls, would then resolve visitors to content served by that person.

A DNS zone is the collection of records for a domain, the full set of phone book entries the owner manages. Nothing in the DNS layer prevents this. A CNAME is a delegation, and once it is in place the target's control over what answers for that name is limited to removing the record. The report does not describe any monitoring or validation that would have caught the stale entry.

Impact

Impact means what an attacker could actually do with the problem, and how bad it would be. If an external party claimed the hostname before the domain owner noticed, they could host arbitrary content at https://subdomain.target.com/. The report lists three consequences:

  • Running phishing scams or malicious campaigns behind a legitimate, trusted brand subdomain.
  • Bypassing corporate allowlists, security filters or WAF rules that automatically trust anything matching *.target.com.
  • General brand damage and loss of user trust.

Some of those terms need explaining:

  • Phishing is a fake page or message designed to make people hand over passwords or payment details. A phishing page on a real company subdomain is far more convincing than one on a random address.
  • An allowlist is a list of things that are trusted by default. A WAF (web application firewall) is a filter that inspects web traffic and blocks suspicious requests.
  • *.target.com is a wildcard pattern meaning "any subdomain of target.com".

The second point is the one that makes this more than a cosmetic issue: filters and allowlists that trust the parent domain by pattern will treat the hijacked host as trusted, so links and payloads served from it inherit that trust. The impact is conditional on someone claiming the hostname first, which the unclaimed state would theoretically allow.

Fix

The report gives two levels of remediation. Remediation is the fix, the change that removes the problem rather than just hiding it.

  • Quick fix: drop the dangling CNAME record from the DNS zone if the campaign or page is dead.
  • Long term: set up automated DNS monitoring to catch stale CNAMEs pointing to third-party cloud providers or SaaS platforms before someone else does.

A dangling record is one that points at something that no longer exists, like a signpost to a demolished building. SaaS stands for software as a service: online products you sign up to and use in a browser, which often let you attach your own domain name.

The first removes the delegation and with it the attack surface. The second addresses the class of problem, since a single cleanup does nothing for the next subdomain that is retired without its DNS entry being removed.

Variants to test

The same pattern applies to any provider that lets customers bind custom domains, and the detection method generalises:

  1. Enumerate CNAMEs to third-party providers. Query each subdomain's CNAME and look for provider endpoints such as ext-cust.squarespace.com. A positive result is a CNAME to a hosting or SaaS provider rather than to infrastructure the target operates. To enumerate means to list things one by one, in this case every subdomain you can find.
  2. Probe for provider error markers. Request the hostname and inspect the body for strings like Domain Not Claimed or Domain connection in progress. A positive result is a provider-specific message indicating the hostname is unbound, rather than a generic 404 from the target's own stack.
  3. Check the server header. A response from the provider, such as server: Squarespace, on a hostname under the target's domain confirms the delegation is live and the provider is answering.
  4. Confirm the binding. Create an account on the provider and attempt to add the hostname as a custom domain. A positive result is the provider accepting the hostname, which verifies the takeover is possible.

Each variant is the same three-part condition: a live CNAME to a provider, an unclaimed hostname on that provider, and a provider that allows arbitrary custom domain binding.

Glossary

  • CNAME record: a DNS entry that forwards one name to another name instead of to an address.
  • Command line: a text interface where you type commands rather than click buttons.
  • curl: a command-line tool that fetches URLs and prints the response.
  • Dangling record: a DNS record pointing at a destination that no longer exists or was never set up.
  • dig: a command-line tool that queries DNS records.
  • DNS: the internet's naming system that translates names like target.com into the addresses computers use.
  • DNS zone: the full set of DNS records an owner manages for a domain.
  • Enumerate: to list items one by one, such as every subdomain of a domain.
  • grep: a command-line tool that searches text and prints matching lines.
  • Header: metadata sent with an HTTP request or response, separate from the page content.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Impact: what an attacker could do with a flaw and how serious the result would be.
  • Phishing: a fake page or message that tricks people into giving away credentials or money.
  • Proof of concept (PoC): a small, safe demonstration that a suspected flaw is real.
  • Recon (reconnaissance): the information-gathering phase of security testing, before any exploitation.
  • Remediation: the fix that removes a vulnerability.
  • SaaS: software as a service, an online product you sign up to and use in a browser.
  • Status code: a number in an HTTP response saying how the request went, such as 404 for not found.
  • Subdomain: a name placed in front of a main domain, such as shop in shop.target.com.
  • Subdomain takeover: claiming a subdomain whose DNS record points at a provider where the name is unclaimed, so you can serve content under someone else's brand.
  • WAF (web application firewall): a filter that inspects web traffic and blocks suspicious requests.
  • Wildcard (*): a pattern meaning "anything", so *.target.com means any subdomain of target.com.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.