Skip to content
XSS Write-up Intermediate

Clickjacking Vulnerability to trigger Reflacted XSS

A page reflected a script payload typed into its search bar, but only as self-XSS. The author chained it with a clickjacking flaw so a victim's clipboard was silently overwritten with the payload and pasted into the search field, turning it into reflected XSS against the victim.

g52238317 Follow

Published on medium.com

First of all, I want to introduce myself, my name is Abdelrhman yasser I am a computer science student, and I am enthusiastic about cyber security in general but specifically interested in penetration testing and bug hunting.

Abdelrhman Yasser, 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 search parameter was echoed into the page without encoding, and the page could be framed because no anti-framing headers were set.

Impact

A victim who visits the attacker's page and pastes into the framed search bar could have attacker-chosen script run in their session on the site.

What the attacker needed

Victim visits attacker page; victim pastes into framed search bar; site allows framing

The fix

The site should encode the search value before rendering it and send anti-framing headers so the page cannot be embedded.

How it was found

  1. Open the page and try a script payload in the reflected parameter.
  2. Notice the payload is altered and does not execute there.
  3. Type the payload into the search bar and see it execute immediately.
  4. Test the page for clickjacking and find it can be framed.
  5. Build a page that overwrites the clipboard and frames the site.
  6. Send it to the victim, who pastes the payload into the search bar.

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.

Reflected XSS means text you type into a page is sent back and run as code by the browser. On its own here it only affected the person typing, so the author used clickjacking: an invisible frame of the real site over a decoy page, so the victim's clicks and pastes land on the real site without them noticing.

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.