Skip to content
XSS Write-up Intermediate

Explorando uma Vulnerabilidade de XSS em um parâmetro Oculto

A login page reflected the 'login' parameter inside a hidden input field without proper encoding, allowing HTML injection. An attacker could craft a link that executes JavaScript in the victim's browser, though the first working payload required user interaction and only worked in Firefox.

medium.com

Published on medium.com

Este é o meu primeiro post, e nele vou compartilhar uma experiência interessante que vivi durante um projeto de pentest (teste de penetração) para um cliente.

cHor4o, 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 the 'login' parameter into an HTML attribute of a hidden input without encoding, allowing an attacker to break out of the attribute and inject new HTML elements with event handlers.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser if the victim opens a crafted link and performs a specific key combination, but the exploit only worked in Firefox and required user interaction.

What the attacker needed

Victim clicks a crafted link; victim uses Firefox; victim presses Alt+Shift+X

How it was found

  1. Use GAU to collect URLs with parameters from the target domain.
  2. Manually review the URLs and find the ResetPassword endpoint with a 'login' parameter.
  3. Inject a test string and observe it reflected in the HTML.
  4. Add a double quote to break out of the attribute and confirm injection.
  5. Try injecting a script tag, which causes a 500 error due to angle brackets.
  6. Inject an element with an accesskey and onclick handler, then press Alt+Shift+X to trigger the XSS in Firefox.

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 placed it inside a hidden form field without cleaning it up. By adding extra HTML code, an attacker could make the page run a small script when a victim opens a crafted link. This is called cross-site scripting (XSS), where an attacker's code runs in someone else'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.

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.