Exploring an XSS Vulnerability in a Hidden Parameter
A hidden input field on a password reset page reflected a URL parameter without proper sanitisation, allowing an attacker to inject an event handler. The attacker could execute JavaScript in the victim's browser, though the first payload required Firefox and user interaction, while a second payload worked without interaction.
medium.com
Published on medium.com
This is my first post, and in it, I will share an interesting experience I had during a pentest (penetration testing) project for a client. While conducting the tests, I came across an injection vulnerability in the password reset 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
Impact
An attacker could execute arbitrary JavaScript in a victim's browser when they visit a crafted URL, potentially leading to session hijacking or other client-side attacks; the first payload only worked in Firefox and required user interaction, but the second payload worked without interaction.
What the attacker needed
Victim clicks a crafted link; Firefox browser (for first payload); user interaction (for first payload)
How it was found
- Use GAU to collect URLs with parameters from the target domain.
- Manually inspect the collected URLs and find the password reset endpoint with a 'login' parameter.
- Inject a test string and observe it reflected in the HTML.
- Try breaking out of the tag with a quote and angle brackets, noting a 500 error when using '<' or '>'.
- Inject event handlers like onmouseover, onfocus, onclick, but they do not trigger.
- Use a payload with a canonical link and accesskey to trigger XSS via keyboard shortcut in Firefox, then use a hidden input payload with oncontentvisibilityautostatechange to trigger without interaction.
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 web address and put it into a hidden form field without cleaning it. An attacker could add extra code that runs in the victim's browser when they visit a crafted link. This is called 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.