That escalated quickly : from partial CSRF to reflected XSS to complete CSRF to Stored XSS
A form lacked anti-CSRF tokens but used a six-digit id parameter as a de facto token, making CSRF only partial. A reflected XSS in another parameter allowed the attacker to read that id from the page and then perform full CSRF, leading to stored XSS.
Published on medium.com
Hey buddies so typically this is my first post on medium . I hope you like it . :) .
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 form relied on a predictable six-digit id parameter as its only CSRF defence instead of a proper unpredictable token, and a reflected XSS in another parameter allowed that id to be read.
Impact
An attacker could perform full CSRF and stored XSS, potentially taking over victim accounts or executing arbitrary script in their browsers.
What the attacker needed
Victim is logged in; victim visits attacker page; attacker can host a page
How it was found
- Find a form that accepts POST requests without an anti-CSRF token.
- Notice a six-digit id parameter that changes per user and blocks a simple CSRF.
- Find a reflected XSS in another parameter of the same request.
- Use the XSS to read the id value from a hidden HTML element on the page.
- Send the id to the attacker's server, then use it to perform a full CSRF.
- The full CSRF leads to stored XSS.
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.
CSRF is when a malicious site makes a logged-in user's browser send a request to another site without the user knowing. Here the form had no secret token to prove the request came from the real site, but it did include a six-digit id that changed per user, which accidentally acted like a token. A separate cross-site scripting (XSS) flaw let the attacker run JavaScript in the page to read that id, so they could then forge a valid request.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.