Skip to content
XSS Write-up Beginner

Stored XSS via Organization Name

The Organization Name field accepted HTML without filtering, and the stored HTML was shown to admins in panels such as invitations and user management. An attacker could store a link that runs JavaScript when an admin clicks it, leading to script execution in the admin's browser.

medium.com

Published on medium.com

Hello, I’m Ahmed Mahmoud. I work as a penetration tester on HackerOne.

Ahmed Mahmoud, on medium.com

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 stored raw HTML in the organisation name and rendered it without escaping or sanitising, allowing a data: URL link to execute script when clicked.

Impact

Attackers could run JavaScript in the browser of admin users, which could lead to cookie theft, phishing, or account takeovers.

What the attacker needed

Ability to create an organisation; ability to send an invitation; admin views the organisation name; admin clicks the stored link

The fix

The application should escape or sanitise all user input before displaying it in HTML, disallow HTML tags in fields like organisation name, and use an allowlist of safe characters.

How it was found

  1. Create a new organisation and set its name to an HTML link containing a data: URL with a Base64-encoded script.
  2. Send an invitation to any email address.
  3. Have an admin visit the invitations panel or another page where the organisation name is displayed.
  4. The admin clicks the 'Click here' link.
  5. A JavaScript alert executes, proving the 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.

A website should treat user input as text, not as code. Here, the site saved HTML tags in an organisation name and later showed them to administrators. The attacker used a link that, when clicked, runs a small script in the admin's browser. This is called stored cross-site scripting because the harmful content is saved on the server and shown to other users later.

What is XSS?

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

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.