Skip to content
XSS Write-up Intermediate

Breaking the Same XSS Twice: Stored XSS in a Welcome Banner — B

A stored XSS vulnerability existed in the organisation Welcome text feature, where the banner was served as raw HTML to all users, allowing an attacker to execute arbitrary JavaScript in their sessions. After the initial fix, the researcher bypassed the denylist filter to achieve stored XSS again on the same feature.

Hossam Hussein Follow

Published on medium.com

I’m Hossam Hussein, a security researcher and bug bounty hunter. In this write-up I’ll walk you through a Stored Cross-Site Scripting (XSS) vulnerability I found in an ERP / procurement platform — and how, after it was fixed, I broke it a second time by bypassing the patch.

Hossam Hussein, 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

The welcome text was stored and served as raw HTML without proper sanitisation, and the subsequent fix used a denylist that could be bypassed.

Impact

An attacker could execute arbitrary JavaScript in victims' authenticated sessions, leading to session theft and potential privilege escalation, and the fix was bypassed.

What the attacker needed

Admin access to set welcome text; victim opens the endpoint or link

The fix

The initial fix was a denylist that was bypassed; the proper fix should use an allowlist HTML sanitizer or render the value as plain text, and serve with a restrictive CSP.

How it was found

  1. As an organisation admin, set a Welcome text containing an iframe with a javascript: URI.
  2. Open the welcome-html endpoint directly as a top-level page.
  3. Observe JavaScript execution in the authenticated session.
  4. After the fix, craft a payload using an unblocked event handler and obfuscated strings.
  5. Save the payload and open the endpoint to trigger the 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.

Stored XSS is when a website saves malicious code and shows it to other users, letting the attacker run scripts in their browsers. Here, an admin could set a welcome message that was shown as HTML to everyone in the organisation, so a malicious admin could steal other users' session cookies. The fix tried to block dangerous words, but the researcher found ways around it.

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 Hossam Hussein

View all

1 more disclosed report, 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.