Chaining a DOM XSS Sink, WAF Bypass, Cross-Origin Smuggling, and SDK Abuse into One Click Account Takeover
A DOM XSS sink in an error page passed a backURL parameter to window.location.assign without scheme validation, and an Akamai WAF rule could be bypassed using property-access syntax. By setting window.name on an attacker page and redirecting the victim to click a button, an attacker could execute JavaScript in the target origin and use a first-party auth SDK to steal a signed JWT and temporary AWS credentials.
Published on infosecwriteups.com
I’ve been hunting on this large platform’s bug bounty program on HackerOne for a while. They have a broad wildcard scope and run Akamai in front of everything meaningful.
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 error-page component passed the backURL query parameter directly to window.location.assign without validating its scheme, and the WAF rule only matched JavaScript keywords immediately followed by an opening parenthesis.
Impact
An attacker could execute JavaScript in the target origin and steal the victim's signed JWT and live AWS STS credentials for two separate AWS accounts, leading to account takeover.
What the attacker needed
Victim clicks a link; victim clicks the Reload Page button; attacker controls a web page
The fix
The error page should parse the backURL value with new URL() and reject any protocol that is not https, and the WAF should reject any request URL whose scheme is javascript: outright.
How it was found
- Set window.name on an attacker-controlled page to the JavaScript payload.
- Redirect the victim to the vulnerable error URL with a backURL parameter using property-access syntax to call setTimeout with window.name.
- The victim clicks the 'Reload Page' button, which executes the JavaScript in the target origin.
- The payload calls the auth SDK methods to retrieve the session, JWT, and temporary AWS credentials, then sends them to the attacker's webhook.
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 error page had a button that would navigate to whatever web address was in a URL parameter, without checking if it was a safe http(s) address. An attacker could make that parameter a javascript: address, which runs code in the page. A web firewall tried to block this, but the attacker found a way to write the code so the firewall did not recognise it, and used a browser feature called window.name to carry the code without putting it in the URL.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.