Reflected in the DOM, Escalated to Account Takeover
A URL parameter was reflected unencoded into a data attribute on a back button, and the page's JavaScript passed that value into a navigation sink, giving DOM-based XSS. Because the Jwt cookie was readable by script and the user's email was exposed in a page variable, the attacker could steal both and replay them against an SSO endpoint to obtain a session as the victim.
medium.com
Published on medium.com
I was casually browsing through the app while logged in, clicking around the interface to map out what was available. Nothing stood out at first.
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 returnUrl parameter was written into a data attribute without encoding and then passed unsanitised into a JavaScript navigation sink, while the authentication cookie lacked HttpOnly and Secure flags.
Impact
An attacker could steal the Jwt cookie and the user's email and use them to obtain a session as the victim through the SSO endpoint, achieving full account takeover with no user interaction and no MFA.
What the attacker needed
Victim is logged in; victim clicks the back button; attacker can send a crafted link
The fix
The issue was patched shortly after being reported.
How it was found
- Open an authenticated connection details page that carries a returnUrl parameter.
- Notice the parameter is reflected into the HTML response.
- Find the value inside a data attribute on a div tied to the back button.
- Supply a javascript: value in returnUrl and reload the page.
- Click the back button and observe script execution.
- Use a payload that sends the cookie and user identifier to an external listener.
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.
A web page took a value from the address bar and put it into the page without cleaning it, then used it as a link destination. By supplying a value that starts with javascript: instead of a normal web address, the tester made the browser run their code when the back button was clicked. That code could read a login cookie that was not protected from scripts, and the tester reused that cookie plus the victim's email to log in as them.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.