Skip to content
UI spoofing Write-up Beginner

API Token Hijacking Through Clickjacking

The report describes a clickjacking vulnerability where an attacker can overlay a transparent iframe of a vulnerable site to trick a victim into clicking a 'copy' button that copies an API token to the clipboard. The victim then pastes the token into an attacker-controlled verification box, sending it to the attacker's server, allowing token theft and potential account takeover.

darklotus Follow

Published on medium.com

{{media:0}}

DarkLotus, 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 did not set anti-clickjacking headers (like X-Frame-Options or CSP frame-ancestors), allowing it to be embedded in an iframe.

Impact

An attacker could steal the victim's API token, which may lead to account takeover by changing the victim's email, disabling 2FA, and so on.

What the attacker needed

Victim visits attacker's page; victim clicks a button; victim pastes token into a box

How it was found

  1. Create a malicious HTML page with an iframe of the vulnerable site and a decoy button.
  2. Set the iframe opacity to zero so the victim sees only the vulnerable site.
  3. Trick the victim into clicking the 'myCODE' button, which copies the token to the clipboard.
  4. Instruct the victim to paste the token into a verification box and submit.
  5. Capture the token from the attacker's server logs.

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.

Clickjacking is when a malicious site hides a legitimate site under a transparent layer, so clicks go to the hidden site. Here, the attacker made the victim click a 'copy' button on the real site, which copied a secret token. Then the victim pasted it into a fake box, giving the token to the attacker.

What is UI spoofing?

The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.

More by darklotus

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Clickjacking and UI spoofing

The lesson behind this report.

The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.