CÓMO DESCUBRÍ UNA VULNERABILIDAD XSS EN UN PROGRAMA VDP
A user ID input field reflected the supplied value into an HTML attribute without filtering, allowing HTML injection. By pre-defining the value attribute and adding an event handler, the author achieved JavaScript execution in the page.
medium.com
Published on medium.com
Mientras navegaba por la aplicación objetivo, me encontré con un formulario de ingreso de usuario que pedía un “User ID”. Hasta aquí, todo parecía normal, pero decidí inspeccionar el código fuente para entender mejor su funcionamiento.
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 user input into an HTML attribute without sanitising or encoding it, and its validation only blocked some payloads rather than the underlying injection.
Impact
An attacker could run JavaScript in a victim's browser, potentially compromising the application's security and user information, though the text does not demonstrate theft of data or account takeover.
What the attacker needed
Access to the target form; victim interacts with the injected field
The fix
The application should sanitise and validate all user-supplied data, and encode output placed into HTML attributes.
How it was found
- Open the target application and find the form asking for a User ID.
- Inspect the source code and notice the input is stored in the value attribute.
- Inject HTML into the field and observe that it is reflected without filtering.
- Try a JavaScript payload and see it blocked by a validation error related to class="required".
- Pre-define the value attribute and append an event-based payload to bypass the restriction.
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 web page took text typed into a form and placed it directly into the page's HTML without cleaning it. By adding extra HTML attributes and an event handler, the author made the browser run their JavaScript when the field was focused. This is called cross-site scripting (XSS): an attacker can run code in a victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.