Skip to content
XSS Write-up Beginner

CVE-2025–63417: The Chatroom Compromise — Stored XSS in xyz Platform

The chat functionality of the xyz Platform stored user messages without sanitisation and rendered them as raw HTML, allowing an attacker to inject a persistent script. Any user who viewed the chat would execute the script, enabling session hijacking, credential theft and account takeover.

Rohit Chaudhary Follow

Published on rohitchaudhary045.medium.com

When a chat system fails to sanitize user input, every message becomes a potential weapon. This is the story of how a single unvalidated input field allowed attackers to plant persistent malware that automatically infected every user who viewed a chat session.

Rohit Chaudhary, on rohitchaudhary045.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 chat messages without server-side sanitisation and rendered them into the page without output encoding, so HTML and script tags were treated as markup.

Impact

An attacker could steal session cookies, tokens and credentials from every user who viewed the chat, leading to mass account takeover and data exfiltration.

What the attacker needed

Ability to send a chat message; victim views the chat room

The fix

The text does not state that the issue was fixed; it recommends sanitising input with a library such as DOMPurify, validating messages on the server, applying output encoding and enforcing a strict Content Security Policy.

How it was found

  1. The attacker sends a chat message containing an HTML payload with an event handler.
  2. The server stores the message content in the database without sanitisation.
  3. When any user opens the chat room, the stored message is rendered as raw HTML and the script executes in their browser.
  4. The script harvests cookies, local storage and tokens and sends them to the attacker.
  5. The script can also change the victim's account email or show a fake login form to capture credentials.

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 you type a message in a chat, the website should treat it as plain text. Here, the site saved the message exactly as typed and later inserted it into the page as if it were part of the website's own code. That let an attacker put a small program (a script) into a chat message, and that program ran in the browser of everyone who opened the chat, stealing their login details.

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 Rohit Chaudhary

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.