This PoC demonstrates how an attacker page can intercept postMessages from HubSpot preview iframes.
The preview pages lack frame-ancestors CSP, allowing any origin to frame them.
Enter a HubSpot preview URL to frame (or use default demo)
This page simulates being hosted on an attacker domain
postMessage(..., "*").includes(".hubspot.com") accepts attacker domains like fake.hubspot.com.evil.comfake.hubspot.com.evil.comThese HubSpot preview URLs can be framed (replace PORTAL_ID with any valid portal):
https://PORTAL_ID.hubspotpreview-na1.com/_hcms/preview/template/...
https://PORTAL_ID.hubspotpreview-eu1.com/_hcms/preview/template/...
https://PORTAL_ID.hubspotpreviewqa-na1.com/_hcms/preview/template/...
The portalId is public and enumerable. An attacker can target any HubSpot customer.