Skip to content
XSS Write-up Beginner

Good Recon, Easy XSS — A Simple Reflected Find in Online Games Platform

A reflected XSS vulnerability was found in a PHP script that passed user input to json_decode() without validation, allowing JavaScript execution. By changing the request method from POST to GET, the attacker could craft a link that executes the payload in a victim's browser, and because cookies lacked HttpOnly and had wide scope, session hijacking was possible.

Waleed Osama Follow

Published on waleedosamaeg.medium.com

Today I’ve got something light and fun — a super simple Reflected XSS I found on a Russian gaming website. I was just messing around with the URLs, and boom 💥 — an alert popped like magic.

Waleed Osama, on waleedosamaeg.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

Impact

An attacker could steal session cookies and hijack accounts, leading to account takeover, because the cookies lacked HttpOnly and were scoped to all subdomains.

What the attacker needed

Victim clicks a crafted link; attacker can host a malicious link

The fix

The application should validate and sanitise user input before passing it to json_decode(), and set the HttpOnly flag on cookies to prevent JavaScript access.

How it was found

  1. Discover the subdomain emblems.**********.net and fuzz it to find 12.php.
  2. Open 12.php and see a form with a textarea and a Convert button.
  3. Submit a simple string and observe the response [data=null].
  4. Submit an empty JSON object {} and recognise the output as coming from json_decode().
  5. Inject a JavaScript payload inside a JSON value and confirm it executes.
  6. Change the request method from POST to GET and confirm the payload still executes, making it a reflected 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.

This is a case where a website took text from a user and turned it into a web page without cleaning it first. An attacker could trick someone into clicking a link that runs malicious code in their browser, and because the site's login cookies were not protected, the attacker could steal them and take over the account.

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 Waleed Osama

View all

4 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.