This document discusses HTML5 postMessage and cross-origin messaging. It begins with an overview of postMessage, how it works, and how it can be exploited in cross-site scripting attacks. It then explains how the same-origin policy impacts postMessage and provides examples of same-origin violations. The document emphasizes that to prevent XSS, the postMessage origin must be correctly checked. It includes code demos and references to illustrate postMessage workings, attacks, and proper origin validation.
5. postMessage?
Controlled mechanism to circumvent SOP.
Dispatches Message Event.
Type (Always message).
Data (User Supplied).
Origin (Origin of the window calling).
Source (window Calling).
15. postMessage Xss
No origin validation on the target.
Attacker crafts a malicious page having an xss
payload
Sending the payload from attackers domain.
XSSed.