This page demonstrates that the Tea SDK collect.js postMessage handler
accepts cross-origin messages from any origin whose string contains one of the
allowlist substrings (e.g. https://data.bytedance.net).
The page's own origin is shown below — it MUST start with
https://data.bytedance.net. for the bypass to demonstrate.
This page's origin:
[send] sent postMessage with type=tea:openHeatMapCore to popup
[recv] message from https://developers.tiktok.com — data: {"type":"...","payload":"... ScriptloadSuccess"}
The smoking gun is the [recv] line: it means the TikTok page's
collect.js handler accepted your message and called the registered
handler, which then called fi(event.source, ...) to send a status
postMessage back to your origin. That callback should never reach a non-TikTok
origin under a correct strict-equality origin check.
collect.js (Ctrl-P, filter "collect").{} icon at the bottom).e.origin.indexOf(t)>-1 — set a breakpoint on that line.e.origin and t. Confirm
e.origin === "https://data.bytedance.net.<yourdomain>.com",
t === "https://data.bytedance.net", and the expression returns
true.