Stored XSS via Profile Name Field
A stored cross-site scripting vulnerability existed in the profile name field, allowing an attacker to inject a script that executed when other users viewed the affected profile. The attacker could steal session cookies from other users.
Published on markazgasimov.medium.com
While performing a routine bug bounty test on a website, I came across a Stored Cross-Site Scripting (XSS) vulnerability in the user profile section.
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 did not sanitise or encode user input before storing and rendering it on the page.
Impact
An attacker could steal session cookies from other users, leading to account takeover, and potentially escalate privileges if an admin views the payload.
What the attacker needed
A free account; victim views the attacker's profile
The fix
The application should sanitise input and encode output, and use a Content Security Policy to restrict script execution.
How it was found
- Register on the platform and go to profile settings.
- Insert a script payload into the display name field and save.
- Refresh the page and observe the script executing and sending cookies to an external URL.
- Create a second test account and log in.
- Visit the profile of the first account and see the payload execute automatically.
- Use Burp Suite to intercept the request and confirm the second user's cookies were exfiltrated.
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 cross-site scripting (XSS) happens when a website saves harmful code (like a script) and later shows it to other people without cleaning it up. Here, the profile name field let a user save a script, and when anyone viewed that profile, the script ran in their browser and could steal their login cookies.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.