Skip to content
XSS Write-up Beginner

HOW I DISCOVERED AN XSS VULNERABILITY IN A VDP PROGRAM

The login form reflected the User ID input directly into the value attribute of an HTML input field without sanitisation. An attacker could inject an event handler that executes JavaScript when the field receives focus, demonstrating reflected XSS.

medium.com

Published on medium.com

During my exploration of the target application, I came across a login form requesting a “User ID.” Although everything appeared normal at first glance, I decided to inspect the source code to better understand its implementation. It was then that I noticed the input value was being stored directly in the value…

Antonio Rivera Poblete, on medium.com

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 encoding or validating it, allowing attribute injection.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser in the context of the vulnerable site, though the report only demonstrates an alert and does not show theft of data or session.

What the attacker needed

Victim visits a crafted URL or page; victim focuses the input field

How it was found

  1. Inspect the login form source and notice the User ID is placed in the value attribute.
  2. Inject a closing quote and HTML to confirm HTML injection is possible.
  3. Try a JavaScript payload but see it blocked by a required validation.
  4. Define the value attribute first, then add an onfocus event handler to bypass the block.
  5. Focus the field to trigger the alert, 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 login form took whatever you typed as the User ID and placed it straight into the page's HTML without cleaning it. By typing special characters and an event handler, the researcher made the browser run their JavaScript when the field was clicked or focused. This is called cross-site scripting (XSS): tricking a victim's browser into running code the site did not intend.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.