News ·
Do the math: How we took over ChatGPT accounts
Researchers chained a MathLive postMessage flaw, an unsandboxed iframe, and a YouTube JSONP trick to escape ChatGPT's Preview sandbox and take over accounts via a shared link; OpenAI fixed it on October 26, classifying it P1.

A research team found a way in October 2026 to turn a public ChatGPT share into attacker-controlled JavaScript running in the signed-in session of whoever opened the link. The victim only had to open the shared link—no app install, project join, code paste, or developer tools required. The payload could enumerate conversations, read private chats never shared with the attacker, and exfiltrate that content to an external server by calling ChatGPT's authenticated APIs as the victim. OpenAI fixed the issue on October 26 and rated the report P1.
The chain started with two innocuous features. ChatGPT's Preview runs HTML code in a sandboxed frame on a separate address, and a graph feature loaded the MathLive math library, which installed a postMessage listener in the main ChatGPT page. MathLive's controller used an origin policy of none and accepted messages from any window, letting the Preview send a message that replaced the virtual keyboard layout with attacker HTML. When the keyboard opened, MathLive assigned that HTML to innerHTML in the real ChatGPT page; a helper named createHTML marked it trusted without sanitizing. An iframe using srcdoc, inserted without a sandbox attribute, then got the chatgpt.com identity and could access the parent page. ChatGPT's CSP blocked inline scripts but allowed YouTube, whose oEmbed endpoint put an unsanitized JSONP callback into its response—ending the callback with ;void neutralized the appended object, so the payload executed as chatgpt.com.
The initial working version required a researcher-controlled App as sender, so the team sought a better delivery via native HTML attachments, which open in the same sandboxed Preview. The article text is cut off before describing how the final share-link delivery worked. For anyone building with AI products, this shows that sandbox escapes can chain through third-party libraries with lax postMessage validation and CSP allowlists, and that sharing features can turn a rendering bug into account takeover.
References
- Hacker News · parameter.ai
Read the full story at Hacker News ↗Like, save or discuss on Buzz


