Skip to content
XSS Write-up Beginner

How I Uncovered Reflected and Stored XSS on a University Portal

The university portal reflected unsanitised user input in a login error message and stored unsanitised input from a registration form, allowing an attacker to inject and execute JavaScript. An attacker could run script in a victim's browser, potentially stealing cookies or conducting phishing.

medium.com

Published on medium.com

Recently, while exploring the website of an educational institute, I came across a classic yet simple vulnerability of Reflected and Stored-XSS through a user-facing login page. Here’s a detailed breakdown of my methodology to find both the vulnerabilities:

Avyukt Security, 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

Likely the application failed to sanitise or encode user-supplied input before reflecting it in error messages and storing it in the database for later display.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing cookies or conducting phishing attacks, though the payment and admission form were out of scope due to third-party and fee requirements.

What the attacker needed

Victim clicks a crafted link; attacker can register an account; no email or phone validation

How it was found

  1. Run a directory scan to find paths on the website.
  2. Test basic SQL injection and XSS payloads on relevant pages.
  3. On the student login page, submit wrong credentials and observe the error message taken from the URL.
  4. Inject an XSS payload into the URL parameter to trigger reflected XSS.
  5. Open the registration page and enter fake credentials with an XSS payload in the name fields.
  6. After registration, browse the portal to find a page that displays the stored payload.

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.

Cross-site scripting (XSS) is when a website takes input from a user and puts it back on the page without cleaning it, so a malicious script can run in another user's browser. Here, the login error message and the registration name field both allowed script to be injected. This could let an attacker steal session cookies or trick users with fake content.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

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.