In-depth lesson · technique
postMessage abuse
What every disclosed postMessage abuse report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- reports cited in this lesson
- 53
- median public bounty
- $1,500
Learning Client-side in depth, step 2
Overview
What it is and why programs pay for it.
postMessage is the browser mechanism that lets windows, iframes, popups and extensions talk to each other across origins. Because it deliberately crosses origin boundaries, the receiving code has to decide for itself whether it trusts the sender and what it is willing to do with the data. When that decision is wrong, an attacker page can drive privileged functionality inside a victim's session. This lesson covers the reports in our database where that trust decision failed, across 55 reports, 21 of which were paid.
Programs care because the impact is often a full account compromise rather than a cosmetic bug. The evidence shows handlers that let an attacker read session tokens, OAuth codes and access tokens, cookies, private repository files, contact form data, screenshots and even NFTs. In several cases the result was account takeover or theft of assets with a single victim interaction.
It turns up wherever one component embeds another: checkout pages with analytics, maps and wallet dialogs, admin panels with pushState routing, chat widgets and contact forms, browser extensions, code editors and notebook renderers, single sign-on flows and sandboxed documents. The common thread is a page that receives messages and acts on them without a strict origin check or without validating the payload.
Seen in these reports13
-
$3,000 -
$1,600 Medium -
$500 Low
Show 5 moreShow fewer
-
$500 Medium -
$500 -
High -
Medium -
How it works
The mechanics, as the reports show them.
The page registers a message listener. Any window that can obtain a reference to it, typically by framing it or opening it, can send it a message. The listener receives the message data and the claimed origin of the sender, and then decides what to do.
The first failure is the origin check. Some handlers do not check at all. Others use a substring or prefix comparison, so a domain that merely contains or starts with the trusted string passes. Others use a regular expression where dots act as wildcards, or compare the origin to the referrer, which the opener controls. Some trust any message from the window that opened the page, or validate only the first message and trust everything after it.
The second failure is what the handler does with the data. Message fields get assigned to innerHTML, passed to eval, used as a URL for navigation without a scheme check, concatenated into an admin path without confirming it stays under the prefix, or used to invoke methods by name. Each of these turns a trusted message into script execution, redirection or access to privileged state.
The third failure is what the handler exposes. Handlers have been shown to return session tokens, cookies, OAuth codes and access tokens, private repository files and user directory paths. Sometimes the leak is a reply message, sometimes a redirect to an attacker domain, sometimes a token posted to a target origin the attacker can influence, including a wildcard.
Timing and edge cases matter. A forged success message sent before the legitimate one can win a race. An empty source in a modal message can bypass a check. A File object's read-only name property can slip past an escaping routine that only handles own properties. A path with an invalid protocol can bypass a path filter. These are the variations that turn a near miss into a working report.
Seen in these reports23
-
$2,500 High -
-
Medium
Show 5 moreShow fewer
-
$3,000 -
$3,000 -
$1,000 High -
$1,000 High -
$500 Low
Year by year
7 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2014 | 1 |
|---|---|
| 2016 | 2 |
| 2017 | 5 |
| 2018 | 4 |
| 2019 | 12 |
| 2020 | 10 |
| 2021 | 6 |
| 2022 | 9 |
| 2023 | 7 |
| 2024 | 2 |
| 2025 | 14 |
| 2026 | 20 |
-
2024
New this year3
- Chained bugs with CSP bypass or DOM clobbering first appear clearly in the disclosed reports this year.
- Abusing a DOM clobbering gadget via postMessage is first documented in the reports.
- Reading an OAuth access token from an office productivity app via postMessage is first shown in the reports.
Kept working5
- Hunters found that message handlers in chat and collaboration apps could be abused to read session tokens, as shown in the reports.
- A message handler in a code editor allowed reading a session token, according to the reports.
Turned up less3
- The review widget token leak from 2023 does not appear in the 2024 reports.
- The WordPress embed token leak from 2023 is not repeated in the 2024 reports.
Reports from 20241
-
High
-
2023
New this year3
- Widgets and embedded iframes first feature prominently as targets in the disclosed reports this year.
- Abusing cloud productivity apps via postMessage first appears clearly in the reports.
- Injecting CSS through a message handler to capture input is first documented in the reports.
Kept working4
- A message handler in a review widget allowed reading a session token, according to the reports.
- A message handler in a WordPress embed allowed reading a session token, as reported.
Turned up less3
- The payment page token leak from 2022 does not appear in the 2023 reports.
- The PDF viewer token leak from 2022 is not repeated in the 2023 reports.
-
2022
New this year3
- Abusing notebooks and code editors via postMessage first appears clearly in the disclosed reports this year.
- Sandboxed documents and iframes first feature as targets in the reports.
- Reading or writing cookies through a message handler on a checkout page is first documented in the reports.
Kept working4
- Hunters found that message handlers on payment pages could be abused to read session tokens, as shown in the reports.
- A message handler in a browser extension allowed reading a session token, according to the reports.
Turned up less3
- The referrer-based origin bypass from 2021 does not appear in the 2022 reports.
- The single sign-on flow token leak from 2021 is not repeated in the 2022 reports.
Earlier years4
Where it is found
44The features and places the reports found it in, most-reported first.
-
Marketo contact form iframe, including the HackerOne Marketo form.
Seen in 4 reports
-
Shopify admin themes page.
Seen in 4 reports
-
Shopify admin panel pushState handler.
Seen in 3 reports
-
Browser extensions.
Seen in 1 report
-
Chat applications.
Seen in 1 report
Technologies in these reports16
Root causes
36The mistakes in the code or configuration behind the reports.
-
A message handler allowed reading a session token.
Seen in 23 reports
-
The handler did not check the origin of incoming messages at all.
Seen in 11 reports
-
The origin check used a substring or prefix match instead of an exact comparison.
-
Message data was passed directly to eval.
-
Message data was assigned to innerHTML without sanitisation.
Seen in 2 reports
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Session token theft from third-party sites
of 3 ticked-
Seen in 5 reports
-
Seen in 3 reports
-
Seen in 3 reports
HTML and script injection via message data
of 3 ticked-
Seen in 3 reports
Browser extensions and sandboxed documents
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
-
Seen in 1 report
Origin validation bypass
of 3 ticked-
Seen in 3 reports
-
Seen in 1 report
-
Seen in 1 report
Bypasses and variations
32How reports got past filters, encoders and other defences.
-
A message handler allowed reading a session token.
Seen in 23 reports
-
A path with parent directory segments escaped the admin prefix.
Seen in 2 reports
-
A message handler allowed reading or writing cookies.
-
A domain whose name begins with the trusted origin string passed a prefix check.
Seen in 1 report
-
A domain containing the trusted origin string anywhere passed a substring check.
Seen in 1 report
Payouts
28 paidPublic bounties in US dollars, from the data. 28 of 121 reports show an amount.
- a quarter paid up to
- $500
- median
- $1,500
- three quarters paid up to
- $3,600
- highest
- $63k
One in ten paid reports was paid $10k or more.
| Severity | Reports | Paid | Median | Highest |
|---|---|---|---|---|
| Critical | 1 | 0 | None paid | None |
| High | 10 | 4 | $1,750 | $5,000 |
| Medium | 14 | 3 | $500 | $1,600 |
| Low | 11 | 6 | $500 | $500 |
| Unrated | 85 | 15 | $3,000 | $63k |
Highest-paid reports5
-
$62,500 -
$22,500 -
$20,000 -
$6,000 -
$5,000
Typical fixes
33How programs fixed it, as the reports describe.
-
Do not allow a message handler to read a session token.
Seen in 23 reports
-
Check the message origin against an exact whitelist rather than a substring, prefix or regex match.
Seen in 3 reports
-
Do not pass message data to eval.
-
Do not assign message data to innerHTML; encode or sanitise it.
Seen in 2 reports
-
Validate that a URL from a message uses an HTTP or HTTPS scheme before assigning it to location.
Tips for beginners
12Advice for a first hunt, drawn from the reports.
-
Write the report around the root cause and the fix: exact origin whitelist, no eval, encode before innerHTML, scheme validation, path prefix checks, no cookie access, validate every message. This helps triage and shows you understand the bug.
Seen in 7 reports
-
Check what the handler will hand back. Session tokens, cookies, OAuth codes, access tokens, private files and directory paths have all been leaked through message replies or redirects. That is usually the strongest impact you can show.
Seen in 6 reports
-
Read the listener code and ask two questions: does it check the origin exactly, and what does it do with the data. A missing check, a substring or prefix match, a regex with dots, or a referrer comparison are all findings worth pursuing.
Seen in 5 reports
-
Follow the data. If a field reaches innerHTML, eval, a location assignment, a path concatenation or a method lookup, work out whether you can turn that into script execution, redirection or access to privileged state.
Seen in 5 reports
-
Start where components are embedded: checkout pages, admin panels, chat widgets, contact forms, browser extensions and code editors. Look for iframes and popups and note which origins they talk to.
Seen in 4 reports
Guides and techniques
The best explainers, cheat sheets and technique posts on postMessage abuse, from around the web.
-
PimpMyCaido #1: Hunt client-side vulnerabilities with DOMLogger++Shows how DOMLogger++ with Caido monitors JavaScript sinks in real time to surface DOM XSS and prototype pollution.
yeswehack.com
-
Exploiting PostMessage vulnerabilities: A complete guideComplete guide to PostMessage flaws, covering how to spot missing or weak origin checks and exploit them for data theft or XSS.
Explainer intigriti.com
-
postMessage XSS: The Listener Nobody AuditsExamines postMessage listeners that are rarely audited and how weak origin checks can lead to cross-site scripting.
Technique kd-200.medium.com
-
postMessage Braindump : a brief postMessage testing methodologySets out a practical methodology for testing postMessage handlers, covering origin checks, message sinks and exploitation paths.
Methodology rhynorater.github.io
-
"Iframe and window.open Magic" by huliHuli explains how iframe and window.open interactions can be abused, covering cross window scripting and related browser quirks.
Technique blog.huli.tw
Keep learning
Where this lesson fits, and what to read next.
Learning paths
The whole class
Related techniques
How this is made: our model read every listed postMessage abuse report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 26 Nov 2026 from 55 reports. All postMessage abuse reports.