Web message DOM XSS occurs if the destination origin for a web message trusts the sender not to transmit malicious data in the message, and handles the data in an unsafe way by passing it into a sink.
You can use DOM Invader to test applications for web message DOM XSS. DOM Invader enables you to log any messages that are sent via the postMessage() method, and modify and resend web messages.
To learn more about sources and sinks, see DOM-based vulnerabilities.
DOM Invader is pre-installed in Burp's browser. It's disabled by default as some of its features may interfere with your other testing activities.
You can follow the processes below using the lab DOM XSS using web messages.
Click each message to review it, and see if the origin, data, or source properties of the message are accessed by the client-side JavaScript:
origin property isn't accessed, it's likely that the origin isn't being validated.
data property isn't accessed, the message can't be exploited.
source property isn't accessed, it's likely the source (usually an iframe) isn't being validated.
You can use the message information to craft an exploit. Use DOM Invader to send a modified web message:
Edit the Data field with an exploit that matches the sink type.
If you find an exploitable vulnerability, use DOM Invader to generate a proof of concept: