XSS in Hidden Input Without User Interaction
A parameter was reflected inside a hidden input field without proper escaping, allowing an attacker to inject an event handler that executes automatically in some browsers. This could let an attacker run script in a victim's browser and access cookies.
medium.com
Published on medium.com
In this write-up, I will explain a reflected Cross-Site Scripting (XSS) vulnerability I discovered on a target we’ll call example.comThe interesting part of this XSS is that it occurs inside a hidden input field and executes automatically, without requiring any user interaction such as pressing keys or clicking…
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 without user interaction in Chrome, Edge, and Brave, potentially stealing cookies; however, the exploit does not work in Firefox or Safari.
What the attacker needed
Victim visits a crafted URL
How it was found
- Visit the URL with the p1 parameter set to a test value.
- Observe that the value is reflected inside a hidden input field.
- Inject a payload that closes the value attribute and adds an event handler and style.
- The payload executes automatically in Chrome, Edge, and Brave.
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 puts user input into a page without making it safe, so an attacker can make the page run their own JavaScript. Here, the input went into a hidden form field, and the attacker added a special attribute that runs code as soon as the page loads in some browsers. That code could steal the user's session cookie, which is like a temporary ID card for the site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.