Skip to content
CSRF Write-up Intermediate

Cross Window Forgery: A Web Attack Vector

A technique called Cross Window Forgery lets an attacker open a target site in a tiny new window with a URL fragment that focuses a sensitive button by its ID. If the victim holds Enter or Space, the browser activates that button, potentially authorising a malicious OAuth app and leading to account takeover.

Paulos Yibelo Follow

Published on paulosyibelo.com

I've uncovered a technique that exposes a new class of client side web vulnerability. By leveraging two seemingly unrelated browser features, an attacker can trick an unsuspecting user into performing actions on a different website with minimal user interaction.

Paulos Yibelo (@PaulosYibelo), on paulosyibelo.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 root cause is that sensitive action buttons have static, guessable ID attributes and browsers focus and activate them via URL fragments, so a cross-origin page can preselect and trigger them with a user key press.

Impact

An attacker could trick a logged-in user into authorising a malicious OAuth application with wide scope, leading to account takeover on sites like Coinbase and Yahoo; the text notes the attack is harder when the target page loads slowly, uses redirects, or has unpredictable URLs.

What the attacker needed

Victim is logged into the target site; victim visits attacker's website; victim holds Enter or Space key; target has static ID on sensitive button

The fix

The issue should be fixed by randomising ID attributes on sensitive buttons so they cannot be guessed cross-origin, or by removing ID attributes from important buttons and moderating abuse.

How it was found

  1. The attacker prepares a website that opens the target OAuth authorisation URL with the sensitive button's ID in the fragment in a new window.
  2. The new window is made very small or hidden so the victim does not notice it.
  3. The attacker instructs the victim to hold Enter or Space while on the attacker's site.
  4. The key press activates the focused button in the target window, authorising the attacker's OAuth application.
  5. The window is closed quickly to hide what happened.

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.

When you visit a web address that ends with a hash and a name, the browser can jump to the element with that name and give it focus. If that element is a button, pressing Enter or Space will click it. The attack hides a tiny window with such a focused button and tricks you into pressing a key, so you click a button on another site without realising.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by Paulos Yibelo

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.