IDOR + Stored XSS Bypass Leads to Account Takeover
An IDOR flaw allowed an attacker to modify another user's widget by changing a leaked UUID, and a stored XSS bypass using a javascript: URL in a link field enabled cookie theft. An attacker could take over accounts by stealing session cookies when a victim clicked a crafted link.
medium.com
Published on medium.com
My name is Yahia Sherif, a security researcher and bug bounty hunter. Today, I'm gonna share with you how I chained IDOR with stored XSS to achieve full account takeover on one of the bugcrowd BBPs
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 application failed to verify that the user owned the widget identified by the UUID, and it did not properly validate or sanitise the URL field, allowing a javascript: scheme to be stored and executed on click.
Impact
An attacker could modify another user's widget and steal session cookies via stored XSS, leading to account takeover, though the XSS required the victim to click the link with ctrl+click or mousewheel due to target="_blank".
What the attacker needed
A business account; victim clicks a crafted link; knowledge of the widget UUID
How it was found
- Create a business account and host a website.
- Capture the edit-widget request in Burp Suite.
- Note the widgetHomepageUuid parameter, which is leaked in the customer website iframe HTML.
- Create a second account and send the same request with the widgetHomepageUuid changed to the first account's UUID.
- Observe a 200 OK response and that the widget content is modified.
- Inject a javascript: payload into the URL field by intercepting the request, then click the link (using ctrl+click or mousewheel) to execute it and exfiltrate cookies.
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.
This report describes two linked security mistakes. First, the app let one user change another user's widget just by knowing a hidden identifier (a UUID) that was exposed in the page source. Second, the app allowed a link to contain JavaScript code that runs when clicked, and this code could steal the user's login cookies, leading to account takeover.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.