Skip to content
XSS Write-up Beginner

Exploiting Stored XSS in a Payment Support System: From Payload I

A support ticket system stored user-supplied HTML and JavaScript without proper escaping, allowing an attacker to inject a script that executed in the browser of any support staff who viewed the ticket. This enabled theft of session cookies and potential account takeover.

EroHack Follow

Published on medium.com

Cross-Site Scripting (XSS) remains a critical threat to modern web applications. Despite improvements in frameworks and validation libraries, many platforms still fail to properly sanitize user input and safely render dynamic content.

EroHack, 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 application failed to properly escape or encode user-supplied content when rendering it in the support ticket view, allowing HTML and JavaScript to be interpreted by the browser.

Impact

An attacker could steal session cookies of support staff, potentially leading to account takeover and access to internal tools; the stored nature means the payload executes every time the ticket is viewed.

What the attacker needed

Ability to submit a support ticket; victim (support staff) views the ticket

The fix

The application should properly escape or encode all user-supplied content when rendering it in HTML contexts, and implement a Content Security Policy to mitigate script execution.

How it was found

  1. Enter a script payload in the ticket message field.
  2. Submit the ticket.
  3. Log in as a support user and open the ticket thread.
  4. The payload executes and sends the support user's cookies to the attacker's server.

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.

When a website shows content that users submit (like a support ticket) without cleaning it first, an attacker can include code that runs in the browser of anyone who views it. This is called stored cross-site scripting (XSS). Here, the attacker put a script in a ticket, and when an admin opened it, the script ran and sent the admin's session cookie to the attacker, letting the attacker log in as the admin.

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 EroHack

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.