Skip to content
XSS Write-up Intermediate

Self XSS To Stored Through IDOR/

A folder name field was not sanitised, allowing script injection, but only the folder owner could see it (self-XSS). An IDOR let a low-privileged user change the company ID to create a folder inside an admin's organisation, turning it into stored XSS that ran when the admin previewed or moved files.

Arben Shala Follow

Published on arben.sh

In this blog post I will explain how I turned a Self-XSS (cross-site scripting) vulnerability into a Stored-XSS by chaining it with an IDOR (insecure direct object reference) vulnerability. By chaining these two, I was able to turn a limited attack into a much more serious one.

arbennsh, on arben.sh

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 folder name was stored and later rendered without output encoding, and the folder creation endpoint trusted a client-supplied company identifier without checking the caller's authorisation.

Impact

A low-privileged user could run script in an organisation administrator's browser and possibly take over their account; there was no WAF and IDs were easily guessable, so exploitation was easy.

What the attacker needed

A low-privileged account; ability to intercept requests; admin previews or moves a file

The fix

The text does not say it was fixed; it should be fixed by validating and encoding the folder name on output and by checking that the caller is authorised for the company and parent folder referenced in the request.

How it was found

  1. Log in as an admin and confirm the malicious folder is not present.
  2. Using a low-privileged account, create a new folder and intercept the request.
  3. Modify the request to set the admin's company ID and parent folder ID, and put a script payload in the folder name.
  4. Return to the admin account and see the malicious folder has been created.
  5. As the admin, preview or move a file inside that folder 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.

Cross-site scripting (XSS) lets an attacker put code into a web page so a victim's browser runs it. Here the folder name was not cleaned, but normally only the creator saw it, so it was harmless. A second flaw, an IDOR, let a low-privileged user change an ID in the request to place that folder inside an admin's account, so the admin's browser ran the code.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Arben Shala

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.