When the Privacy Tool Has a Privacy Problem: Finding My First XSS
A reflected cross-site scripting vulnerability existed because a POST parameter was inserted directly into a JavaScript variable without validation or escaping. An attacker could craft a URL that executes arbitrary JavaScript in a victim's browser, potentially stealing cookies or manipulating test results.
Published on akashmadanu.medium.com
I wasn’t looking for vulnerabilities that day. I was just checking if my VPN was leaking DNS queries — something I do probably twice a month.
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 a user-supplied POST parameter directly into a JavaScript variable without validating it against a whitelist or escaping it for the JavaScript context.
Impact
An attacker could steal session cookies, redirect users to malicious sites, manipulate test results, or launch phishing attacks, though the text does not confirm whether defences like HttpOnly or CSP were present.
What the attacker needed
Victim clicks a crafted link; no account required
The fix
The vulnerability should be fixed by validating input against a whitelist, applying context-aware output encoding, implementing a strict Content Security Policy, and marking cookies as HttpOnly.
How it was found
- Intercept the POST request sent when clicking the test button.
- Identify the parameter in the request body that holds the selected test option.
- Inject a simple script payload and observe that angle brackets are filtered.
- URL-encode parts of the payload and resend until the script executes.
- Confirm execution by seeing an alert box displaying cookies.
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 a website takes something you type or send and puts it directly into the page without cleaning it first, an attacker can send special text that makes the browser run their code. This is called cross-site scripting (XSS). Here, the attacker could trick someone into clicking a link that runs malicious JavaScript, which could steal their cookies or change what they see.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.