Skip to content
Safety · Nov 1, 2026

Researchers describe cross-site scripting exploit in ChatGPT’s HTML preview feature

A complex attack chain leveraged sandboxed iframes, postMessage, innerHTML, and YouTube’s oEmbed endpoint to execute JavaScript and exfiltrate private user data.

Trust79
HypeLow hype

1 source · cross-referenced

ShareXLinkedInEmail
TL;DR
  • A security research team described a cross-site scripting exploit in ChatGPT’s HTML preview feature that enabled account takeover.
  • The attack chain involved sandboxed iframes, postMessage, innerHTML injection, and abuse of YouTube’s oEmbed endpoint to bypass Content Security Policy.
  • OpenAI patched the vulnerability and awarded a $5,000 bug bounty.

Researchers at Parameter Labs documented a cross-site scripting (XSS) vulnerability in ChatGPT’s HTML preview feature, which renders interactive custom HTML apps within sandboxed iframes. The feature, previously referred to as Canvas by OpenAI, is designed to isolate untrusted code and prevent interaction with OpenAI’s APIs or access to private user data.

The attack chain began with the MathLive JavaScript library, used by OpenAI for graph support, which exposes a virtual keyboard that can be triggered via postMessage from a sandboxed iframe. The parent page’s message handler used innerHTML to render content, and lacked protections to restrict which frames could invoke this method. This allowed untrusted iframe content to inject arbitrary HTML into the parent context.

While innerHTML does not directly execute script elements, the injected HTML could include a new iframe without sandbox attributes, enabling further escalation. OpenAI’s Content Security Policy blocked inline scripts and restricted script loading to a limited set of domains, but YouTube was among the permitted domains. The researchers found that YouTube’s oEmbed endpoint could reflect JavaScript back in a way that executed within the ChatGPT context, achieving full JavaScript execution.

With JavaScript execution established, the exploit could fetch private user data from OpenAI APIs and exfiltrate it via an image reference. The vulnerability could be triggered by a malicious ChatGPT share URL; when visited by another signed-in user, the URL would exfiltrate their private data or allow actions on their behalf.

OpenAI closed the vulnerability after being notified and paid a $5,000 bug bounty. The researchers characterized the payout as disproportionately low given the severity of the issue.

Sources
  1. 01Simon Willison’s Weblog — How We Took Over ChatGPT Accounts
Also on Safety

Stories may contain errors. Dispatch is assembled with AI assistance and curated by human editors; despite the trust-score filter, mistakes happen. We correct publicly — every article links to its revision history. Nothing here is financial, legal, or medical advice. Verify before relying on any claim.

© 2026 Dispatch. No ads. No sponsorships. No paid placement. Reader-supported via Ko-fi.

Built by a person who cares about honest AI news.