From Self-XSS to Account Takeover: How I Turned a Low-Severity Fi
A product description field allowed HTML injection that executed only in the admin panel when an owner edited the product. A lower-privileged manager could store a payload that ran in the owner's session, leading to account takeover.
Published on medium.com
While testing an e-commerce platform that allows merchants to create stores and sell products online, I discovered a vulnerability that initially looked almost useless.
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 missing output encoding of the product description when rendered in the admin panel, combined with insufficient privilege separation between managers and owners.
Impact
A lower-privileged manager could execute JavaScript in the store owner's session, leading to full account takeover including changing settings, phone numbers, emails, and deleting the store.
What the attacker needed
A store account; ability to add staff members; victim (owner) opens product edit page
How it was found
- Create a store account and explore product upload functionality.
- Test the product description field with a simple broken image payload and observe execution.
- Intercept the request and adjust the payload to bypass client-side sanitisation.
- Create a manager account with product management permissions.
- Using the manager account, create a product with the payload in the description and publish it.
- Log in as the owner and open the product editing page to trigger the payload.
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 is a stored cross-site scripting (XSS) bug: a user can save code in a product description, and that code runs later in someone else's browser. At first it seemed harmless because only the person who entered it saw it run, but a manager could make the store owner run it, giving the manager control of the owner's account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.