Hunting eval() XSS: How I Scored a $10K Bounty from Uber
A third-party analytics script on Uber's web app Base64-decoded a user-controlled URL parameter and passed it directly to eval(), allowing DOM-based XSS. An attacker could craft a link that executes arbitrary JavaScript in the page context, potentially stealing tokens or manipulating the UI.
medium.com
Published on medium.com
When a tiny Node.js script lit up my console with a simple [!] Detected eval() warning, I knew I’d stumbled onto something big. In this deep dive, we’ll explore how I uncovered a DOM-based XSS in Uber’s web app, the anatomy of the vulnerability, real bounty-winning case studies, and actionable tips to sharpen your…
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
Impact
Attackers could execute arbitrary JavaScript in the page context, potentially stealing tokens, hijacking sessions, manipulating the UI, or redirecting users.
What the attacker needed
Victim clicks a crafted link
The fix
The eval() call should be replaced with a safe parser such as JSON.parse, and input should be validated and sanitised before processing.
How it was found
- Notice a new analytics script loaded from a third-party CDN.
- Scan the script and find an eval() call on Base64-decoded data.
- Craft a URL with a Base64-encoded JavaScript payload in the data parameter.
- Visit the URL and observe the alert box confirming code execution.
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 website took a value from the address bar, decoded it, and ran it as JavaScript code. Because the site trusted that value, an attacker could put their own code in the link and make the victim's browser run it. This is called DOM-based cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.