Skip to content
XSS Write-up Beginner

Reflected XSS on Gaming Blog Website

A calculator page on a gaming blog reflected user input inside a textarea without proper escaping, allowing an attacker to break out of the textarea and execute arbitrary JavaScript. The attacker could run script in a victim's browser, as demonstrated by a print dialog.

enigma_ Follow

Published on medium.com

I found a reflected XSS vulnerability on a website I used to frequent when playing a text-based MUD (multi user dungeon).

enigma_, 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 input directly into the HTML inside a textarea element without escaping or encoding it, so closing the textarea tag allowed script injection.

What the attacker needed

Victim visits a crafted URL or submits input

How it was found

  1. Enter a value into the level input box on the calculator page.
  2. Inspect the page source and notice the input is placed inside a textarea tag.
  3. Submit a payload that closes the textarea and adds a script tag calling print().
  4. Observe the print dialog appear, confirming script execution.

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 takes input from a user and puts it into a page without making it safe, so an attacker can sneak in their own code. Here, the input box was placed inside a text area, but by closing that area early, the attacker could add a script that runs in the browser of anyone who views the page. This could let an attacker do things like steal cookies or act as the user.

What is XSS?

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

More by enigma_

View all

5 more disclosed reports, best first.

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.