Hacking NASA: Critical SSRF + Subdomain Takeover + XSS
A GeoServer instance on a NASA subdomain was vulnerable to SSRF, allowing an attacker to access the AWS instance metadata service and obtain temporary credentials. Separately, a dangling DNS record pointed to a Meteor Galaxy hostname that could be claimed, and a reflected XSS existed in a GET parameter on a development site.
Published on nickguitar.medium.com
A couple of months ago, I was really excited about doing bug bounty on NASA. Just like any other giant company, they have tons of services and webpages publicly available, and it is really hard for them to keep track of everything.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the GeoServer version was affected by CVE-2021-40822, which allows SSRF via the TestWfsPost endpoint; the subdomain takeover was due to a dangling DNS record pointing to an unclaimed Meteor Galaxy hostname; and the XSS was caused by unsanitised user input being placed directly into a JavaScript variable context.
Impact
An attacker could obtain AWS credentials from the metadata service, potentially leading to RCE or infrastructure takeover; could serve arbitrary content on a NASA subdomain; and could execute JavaScript in a victim's browser via a crafted link.
What the attacker needed
Publicly accessible GeoServer instance; Ability to send HTTP requests; Meteor account and credit card; Victim clicks a crafted link
The fix
The vulnerabilities were fixed by NASA within two weeks of reporting.
How it was found
- Enumerate subdomains of the target domain using various tools.
- Run nuclei with default templates against the collected subdomains.
- Identify a GeoServer instance vulnerable to CVE-2021-40822 from nuclei output.
- Send a POST request to the GeoServer TestWfsPost endpoint with a URL parameter and Host header pointing to an attacker-controlled domain to confirm SSRF.
- Use the SSRF to access the AWS instance metadata service at [redacted] and retrieve credentials.
- For the subdomain takeover, resolve the DNS of a subdomain flagged by nuclei and find it points to a dead Meteor Galaxy hostname.
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 write-up has not been written yet. The Original tab links to the source.
The report describes three separate security holes. First, a server could be tricked into fetching any web address the attacker chose, including a special cloud address that hands out secret login keys. Second, a forgotten DNS record pointed to a service anyone could sign up for, letting someone else serve content on a NASA subdomain. Third, a web page inserted part of the URL directly into its JavaScript, so a crafted link could run attacker code in a victim's browser.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.