Skip to content
XSS Write-up Beginner

XSS (Cross-Site Scripting reflejado y persistente)

A web application reflected and stored user input without validating whether it was text or code, so a script entered in a search field or a comment executed in the browser. An attacker could run their own script in a victim's browser through a crafted input or a stored comment.

medium.com

Published on medium.com

Cuando el navegador no controla que el script que le pasamos no sea solo texto y deja pasar código, estamos hablando de un XSS o Cross-Site Scripting. El realizar dicho ataque es más fácil de lo que parece, tan solo tenemos que escribir en un campo de entrada de datos de la web un script malicioso que contenga nuestro…

TheWhiteRabbit_hack, 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 inserted user-supplied input into the page without encoding or validating it, so the browser interpreted it as executable code.

Impact

An attacker could execute arbitrary script in a victim's browser, either once via a crafted input or persistently for every visitor of a page with a stored comment.

What the attacker needed

A field that reflects input; a comment field that stores input

How it was found

  1. Enter a script in a search field on the site.
  2. Submit the search and observe the script executing in the page.
  3. Enter a script in a comment field instead.
  4. The comment is stored in the page HTML and the script runs each time the page is accessed.

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 sometimes shows back whatever you type into it. If the page does not treat that text as plain text but lets it run as code, a script written by an attacker runs in the browser of anyone who views it. This is called cross-site scripting, and it can be reflected (shown once from a link or search) or stored (saved in a comment and shown to every visitor).

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.