GSA Bounty · Report #263902
{REDACTED}.data.gov subdomain takeover.
Summary
@edio discovered a number of related subdomain takeover attacks against some subdomains of data.gov.
Technically, these domains are out of scope for our Vulnerability Disclosure Policy. We want to remind hackers to please limit their testing to domains explicitly listed in that scope (which is repeated on our HackerOne program page for convenience). This is for your own safety: we want to be sure that everyone's on the same page about your activities being authorized.
That said, this was a legitimate vulnerability, which we fixed, and we're disclosing details because they may be useful to other folks who operate services like ours.
We couldn't just remove the DNS entries, since those are used for internal purposes with agency CNAMEs. However, there were other ways we were able to resolve this by routing requests for unknown domains differently, and now serve 404s for these subdomains.
A few more details about the cause and solutions:
- For the subdomain in question, this was caused by a combination of how were routing requests to unknown domains and how we served static websites.
- The basic issue was that our servers used our
{REDACTED}.data.govdomain as a fallback for any unknown domain requests routed to us. So if a request came in for particular subdomains, we would end up treating it sort of like a request tohttps://{REDACTED}.data.gov. Since we proxied our home page requests to the same host where{REDACTED}.data.gov's static site is currently hosted, and we passed along the original HTTP Host header for these unknown domains, it meant that the host would respond as if that unknown domain had been accessed directly on that host. As demonstrated, users could then to serve up content on these other domains. - So all that being said, the fix was actually straightforward, since it just involved disabling using the
{REDACTED}.data.govwebsite as a fallback for unknown domains. This should mean that the only requests we forward now are actually ones for the{REDACTED}.data.govdomain.
Thanks for the find, @edio - we really appreciate it!
[See also #263542, which was an independent discovery of the same issue on a different subdomain.]
Using a combination of tools and techniques described in https://edoverflow.com/2017/github-recon/, I was able to take control of 7 different subdomains linked to {REDACTED}.data.gov.
Working with the TTS was a pleasure, thanks to their fast responses and quick resolution times. On top of that, they took the extra time to explain the root cause to me so I could better understand what was happening. Once again, thank you to the TTS and I look forward to working with them again in the future!
How it was found
The write-up for this report has not been downloaded yet, or the program disclosed it without one. Read it on HackerOne.