My First Day Learning XSS — and I Found a Real Bug on My Un
A university website reflected unsanitised user input, allowing a simple script tag to execute in the browser. An attacker could use this reflected XSS to steal session cookies or perform actions as the victim.
Published on medium.com
It was literally my first day learning XSS. I was going through some basic payloads and testing how input reflects on web pages — just out of curiosity.
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 reflected user-supplied input into the HTML response without encoding or sanitising it.
Impact
An attacker could steal session tokens or perform malicious actions on behalf of a victim, though the author only demonstrated cookie access in their own browser.
What the attacker needed
Victim clicks a crafted link; reflected input is not encoded
The fix
The issue was fixed by the university, likely through output encoding, HttpOnly cookies, input sanitisation, and possibly a Content Security Policy.
How it was found
- Type a basic script tag into an input field on the university website.
- Observe a popup showing '1', confirming script execution.
- Change the script to read document.cookie and observe session data in the popup.
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.
The website took text from the address bar and put it straight into the page without cleaning it. When the author typed a tiny script, the browser ran it as if the site itself had written it. That let the script read the user's login cookie, which is like a temporary ID card for the session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.