Skip to content
CSRF Write-up Intermediate

One postMessage Was Enough to Break a Trust Boundary (CSRF)

The application's postMessage handler did not validate the sender's origin before acting on message properties, allowing an attacker-controlled website to trigger trusted client-side functionality. This could enable client-side abuse involving promotional workflows or other trusted UI interactions.

RootXSec Follow

Published on medium.com

Most bug bounty discoveries don’t begin with an advanced exploit. No SQL Injection.

Rootxsecurity, 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

The receiving code did not verify the origin of incoming postMessage events before processing them.

Impact

An untrusted origin could trigger trusted client-side functionality, potentially increasing the attack surface for client-side abuse involving promotional workflows or other trusted UI interactions.

What the attacker needed

Victim visits attacker-controlled website; victim has the application open or opens it via popup

The fix

The application should validate the sender's origin before processing any message and avoid using '*' as the targetOrigin.

How it was found

  1. Create an HTML page that opens the legitimate application in a popup.
  2. Wait for the client-side components to initialize.
  3. Send a crafted postMessage payload to the popup.
  4. Observe that the application accepts the message and reaches campaign-related client-side logic.

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.

Websites can send messages to each other using a browser feature called postMessage. The receiving site should check who sent the message, but here it did not. So a malicious site could send a message that the trusted site would act on, potentially causing unwanted actions.

What is CSRF?

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

More by RootXSec

View all

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