Skip to content
XSS Write-up Intermediate

Decoding Puzzled Xss Unveiling The Hidden Vulnerability

A reflected cross-site scripting vulnerability existed in a PHP page where user input was transformed by a simple character substitution before being placed into a meta tag. An attacker could craft a link that, when visited, would execute arbitrary JavaScript in the victim's browser.

Shlok K Follow

Published on infosecwriteups.com

Hello everyone. Shlok (pphreak100) this side.

Shlok K, on infosecwriteups.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 applied a reversible character substitution to user input but did not properly encode or sanitise it before inserting it into an HTML meta tag, allowing script injection.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser when the victim visits a crafted link, potentially leading to session theft or other client-side attacks.

What the attacker needed

Victim clicks a crafted link

The fix

The vulnerability was fixed by the programme, as indicated in the timeline.

How it was found

  1. Enumerate subdomains and filter for live PHP-based domains.
  2. Fuzz the target domain to discover a file named password.php.
  3. Visit the page and inspect the source to find a meta tag with parameters token, uid, and email.
  4. Use a parameter discovery tool to identify the 'e' parameter.
  5. Test with a simple payload and observe that characters are swapped according to a known algorithm.
  6. Craft a payload that, after swapping, becomes a script tag with a JavaScript alert.

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 proper cleaning, so an attacker can make the site run their own code. Here, the site tried to hide the input by swapping letters, but the swap was easy to reverse, so the attacker could still inject a script.

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.