In-depth lesson · postMessage abuse
Tips for beginners
Every point the postMessage abuse reports back under this heading, best-backed first, each with the reports it is seen in.
-
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
-
Try the edge cases: an empty source, a forged message sent before the legitimate one, a File object in the payload, an invalid protocol in a path. These bypasses are documented in the evidence and are easy to miss.
Seen in 4 reports
-
Test the origin check with a domain you control that contains or starts with the trusted string, or that matches when dots are treated as wildcards. Registering such a domain is often the whole bypass.
Seen in 3 reports
-
For extensions and sandboxed pages, look at whether a message can load an arbitrary script, inject CSS, or traverse a custom protocol to load attacker content. These are variants of the same trust failure.
Seen in 3 reports
-
Check scope before you invest. Many of these reports are on third-party widgets, SDKs and integrations rather than the main application, and some programs exclude them. Confirm the asset is in scope and that the impact lands on the program's users.
Seen in 3 reports
-
Show impact with a realistic victim flow: a page the victim visits, a message sent, and a concrete result such as a token read or an action taken in their session. A handler that accepts a message but does nothing useful is not a finding.
-
Avoid reporting a missing origin check on its own. The evidence shows the paid reports pair the check failure with a concrete consequence: token theft, account takeover, file read or asset theft.
-
Check whether a target origin is taken from a URL parameter without a whitelist, including a wildcard. If so, a token can be posted to a window you control.
Seen in 1 report