Beyond IDOR: Discovering a Stored XSS in a Vulnerable Web Platfor
The profile First Name field was rendered back into the page without encoding, so a saved name containing HTML and a JavaScript event handler executed in the browser. An attacker could store a script that runs in the session of anyone, including an administrator, who views the affected profile.
After identifying an IDOR vulnerability on redacted.com [referring to my previous writeup], I decided to dig a bit deeper. I noticed that the application handles user-supplied input in the 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 stored the First Name value and rendered it into the profile HTML without context-aware output encoding, allowing injected markup and event handlers to execute.
Impact
Because the value is stored, the script could run in the session of any user or administrator who views the profile, allowing session hijacking, actions on their behalf, or redirection to malicious sites.
What the attacker needed
An account on the target site; ability to edit the profile First Name; victim views the affected profile
The fix
The report recommends server-side input validation and context-aware HTML output encoding so that characters such as angle brackets are treated as text rather than executable code; it does not state that a fix was deployed.
How it was found
- Open the profile edit section of the account settings page.
- Enter a crafted value containing markup and a JavaScript event handler into the First Name field.
- Save the profile and observe the script executing when the page reloads.
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 your name into a profile, the site usually shows it back to you on your account page. This site put the name into the page without cleaning it first, so if the name contained code instead of plain text, the browser ran that code. Because the name is saved, the code runs for anyone who later opens that profile, not just the person who typed it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.