registry.nodejs.org Subdomain Takeover
An abandoned nodejs.org subdomain was pointing to Fastly, which allows anyone to register a distribution for a domain without proving ownership. The researcher took over the subdomain and received over 300 requests for npm packages, showing that an attacker could have served malicious packages.
- Triaged in 25 hours
- Fixed in 11 days
- Disclosed after 15 days
I recently found an abandoned and/or overlooked nodejs.org subdomain that was indirectly pointing to Fastly. Fastly doesn't require any proof of DNS ownership to register new distributions that use a given domain, so I was able to effectively take it over.
Vulnerability: Subdomain Takeover via Fastly Host: http://registry.nodejs.org
Solution: There are two possible solutions to remediate this issue:
1.) If you no longer wish to use registry.nodejs.org, you can simply delete the registry.nodejs.org CNAME record that is currently pointing to registry.npmjs.org.
2.) Alternatively, if you would like to continue using and/or supporting registry.nodejs.org, you can coordinate with me, I will delete my Fastly service so that someone from nodejs.org can add the registry.nodejs.org domain to the "Domains" field in the related Fastly service. This should be done in a timely and coordinated fashion to prevent another researcher (or less savory type) from registering it before you are able to.
Impact
Since discovering this vulnerability I have received more than 300 requests for various npm packages. A malicious attacker could have used this access to begin delivering backdoored (or otherwise malicious) packages to users who were not using the correct registry setting of registry.npmjs.org.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the subdomain's DNS pointed to Fastly, and Fastly allowed anyone to register that domain without verifying ownership.
Impact
A malicious attacker could have used this access to deliver backdoored or otherwise malicious packages to users who were not using the correct registry setting.
What the attacker needed
Abandoned subdomain pointing to Fastly; Fastly account
The fix
The report suggests either deleting the CNAME record or coordinating with the researcher to transfer the Fastly service to nodejs.org.
How it was found
- Find an abandoned nodejs.org subdomain that points to Fastly.
- Register a new Fastly distribution using that subdomain, since Fastly does not require DNS ownership proof.
- Observe incoming requests for npm packages, confirming the takeover.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A subdomain is a prefix like 'registry' added to a main domain. If that subdomain points to a third-party service that does not check who owns the domain, anyone can claim it and control what the subdomain shows. Here, the researcher claimed the subdomain and could have sent out harmful software packages to people who used it.
What is Subdomain takeover?
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.