From IDOR to Stored XSS to Account Takeover — Chaining Bugs Like a Pro
An unauthenticated admin endpoint allowed editing product descriptions, and the oldimage parameter was reflected unsanitised into an img tag, enabling stored XSS. The session cookie lacked HttpOnly, so the XSS could steal it and take over accounts.
Published on waleedosamaeg.medium.com
So I was casually poking around a website for a game (you know, just your average day of legally breaking stuff), when suddenly… things got interesting.
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
An attacker could steal session cookies from users visiting the store page and take over their accounts.
What the attacker needed
No authentication needed; victim visits the store page
The fix
The report does not state a fix, but the endpoint should require authentication and the oldimage parameter should be properly encoded, and the session cookie should be set HttpOnly.
How it was found
- Fuzz the website to find the /admin/ directory.
- Crawl the admin page to discover backend.js, which lists API endpoints.
- Identify ajaxEditStore.php as an endpoint that does not require login.
- Send a POST request to ajaxEditStore.php with parameters including product_id and product_desc to edit a product.
- Set the oldimage parameter to a crafted value that breaks out of the img src attribute and injects an SVG with an onload handler.
- Refresh the store page to trigger the XSS and steal the zeus cookie.
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 had a hidden admin page that anyone could use without logging in. One of its features let you change product details, and a field meant for an image name was inserted into the page without cleaning, so a script could run. Because the login cookie could be read by JavaScript, that script could steal it and log in as other users.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.