Find Reflected Cross-Site Scripting (XSS) in Government Site
A reflected cross-site scripting flaw was found in the login parameter of a government site's authentication endpoint, where user input was echoed back without proper escaping. An attacker could craft a URL that runs JavaScript in a victim's browser, potentially stealing session data or performing actions as the user.
medium.com
Published on medium.com
A Reflected Cross-Site Scripting (XSS) vulnerability was discovered in the login=badanusaha parameter at the /Landing/Auth endpoint of pasti.pasuruankota.go.id. The vulnerability enables attacker-controlled JavaScript execution in the context of the target domain when a victim visits a specially crafted URL.
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 the parameter value into the HTML response without context-aware escaping, and its input filters could be bypassed with encoded or mixed-case payloads.
Impact
If cookies are not HttpOnly, an attacker could steal session cookies and take over accounts, perform actions as the user, show fake login prompts, or deface public pages.
What the attacker needed
Victim clicks a crafted link
The fix
The application should normalise input before validation, enforce whitelist validation, and apply context-aware output escaping, with CSP and cookie hardening as extra layers.
How it was found
- Open the authentication endpoint URL with the crafted login parameter value.
- Observe that the script executes and an alert box appears.
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.
Reflected cross-site scripting (XSS) happens when a website takes something you type into a link and shows it back on the page without cleaning it first. If that something is a small script, the victim's browser will run it as if the website itself had written it, letting the attacker do things like read the page or act as the logged-in user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.