Reflected XSS via a hidden parameter on Dutch Gov. website
A hidden GET parameter 'source' was reflected unencoded inside a script tag, allowing an attacker to break out and execute JavaScript. An attacker could send a crafted link to an administrator to steal session cookies and access the back-office.
This summer I came across the Bug Bounty program of the Dutch Government, and I saw that as a reward it offers you a super cool t-shirt ! I have to redo my wardrobe, so why not give it a try ? ๐
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
The application reflected the 'source' parameter into a script tag without HTML-encoding it, allowing script tag injection.
Impact
An attacker could steal an administrator's session cookies and gain access to the back-office, though this relies on the victim clicking a crafted link and cookies not being protected by HttpOnly.
What the attacker needed
Victim clicks a crafted link; cookies not protected by HttpOnly
The fix
The vulnerability was fixed by the Dutch government security team a few days after reporting.
How it was found
- Browse the site with a proxy to record requests.
- Use a parameter discovery tool to find hidden GET parameters.
- Identify the 'source' parameter as reflected in the page source.
- Inject a payload that closes the script tag and opens a new one with JavaScript.
- Observe the alert box confirming XSS.
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.
A website took a value from the URL and put it directly into the page's code without cleaning it. An attacker could craft a link that, when clicked, runs their own code in the victim's browser. This is called reflected cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.