In October 2026, a research team at parameter.ai discovered a way to compromise ChatGPT accounts by sending a single shared link. The vulnerability turned an ordinary public conversation share into attacker-controlled JavaScript that executed inside the signed-in session of whoever opened it. A victim needed only to visit the link—no app installation, no code pasting, no developer tools. The exploit gave the payload access to enumerate conversation lists, read private message content, and send data to external servers, effectively taking over the victim's ChatGPT account.

The graph and preview that started the chain

The research began with a question about ChatGPT's Preview feature, which renders HTML code blocks as small webpages inside a restricted frame on a different web address. The isolation seemed intentional: code inside the Preview could not access the parent ChatGPT page. Alongside this, a normal interactive graph appeared in the conversation. Behind the scenes, that graph loaded a math library called MathLive.

MathLive did more than draw graphs. It also installed a message listener in the main ChatGPT page for keyboard-related messages. Browsers provide the postMessage API as a legitimate way for frames to exchange information even when prevented from reading each other's pages. The metaphor of a mail slot applies: the restricted Preview could not enter the main page, but it could drop a message through the slot. Safety depended on the receiver checking who sent the message.

MathLive failed that check. Its listener accepted a message that changed the virtual keyboard layout, and that layout was permitted to contain HTML. The graph had installed the receiver; the Preview provided an untrusted sender. Two separate features had accidentally created a path across the sandbox.

The message that should not have worked

The Preview sent two messages. The first replaced the virtual keyboard layout with HTML controlled by the attacker. The second instructed MathLive to show the keyboard, causing it to render the new layout. MathLive recognized the public message type, but its top-level controller used an origin policy of none, meaning it accepted messages from any web address. It also did not require the update-setting message to come from a previously approved window. Anyone who could reach the listener and knew the message format could replace the layout.

When the keyboard opened, MathLive joined the supplied layout into an HTML string and assigned it to innerHTML in the real ChatGPT page. A helper named createHTML initially seemed like it might sanitize the value. It did not; it marked the string as trusted and passed the attacker-controlled HTML through unchanged.

Script tags inserted through innerHTML do not run automatically, so JavaScript execution was not yet possible. The next step involved an iframe using srcdoc, a browser feature that lets an embedded frame carry its HTML directly in an attribute. MathLive inserted this frame into the main ChatGPT document without a sandbox attribute. Two properties made this useful: srcdoc created a fresh document where an external script could execute, and because the main ChatGPT page created the frame, the browser gave it the https://chatgpt.com web identity. Code inside the new frame could therefore access the parent page.

Bypassing content security policy with YouTube JSONP

ChatGPT's Content Security Policy, or CSP, blocked inline JavaScript as intended. However, the policy allowed scripts from YouTube. YouTube's oEmbed endpoint supported a JSONP-style callback parameter. JSONP responses are JavaScript rather than ordinary JSON. The endpoint attempted to reject an invalid callback, but it placed the callback into the response before returning its validation error.

The response began with the callback wrapper, and ending the program with ;void made the object appended by YouTube harmless. Since YouTube was already allowed by ChatGPT's CSP, the browser loaded this response as a script and ran the callback inside the new frame. At this point, arbitrary JavaScript was running as chatgpt.com. The original Preview remained isolated on its separate address, but the exploit had crossed the boundary by convincing a trusted component in the main page to create an unsandboxed document.

From lab bug to one public link

The early working version used a researcher-controlled ChatGPT App as the sender, which a victim would have needed to connect or invoke first. That was not a convincing real-world attack. The team then tried delivering the payload through a native HTML attachment, but when the conversation was exported as a public share, the attachment remained while the earlier graph did not. The graph was essential because it loaded MathLive and installed the vulnerable message listener in the main page.

The breakthrough came from placing both pieces— the graph that initialized MathLive and the HTML Preview that sent the messages— into one ordinary public conversation. The resulting /share/ link preserved the complete chain for another user. The attacker could deliver it through email, chat, a support ticket, or a social post. The victim did not need to install anything, join the attacker's workspace, or authenticate through an attacker-controlled flow. Opening the shared link was the only required action.

Two interaction versions were observed. In the most stable reproduction, the victim opened the share and clicked ChatGPT's normal Preview button once. Later, the HTML block was marked as previewable so that ChatGPT opened it automatically. In that version, opening the link was the victim's only click. The alert appeared after roughly 4.5 seconds. The graph and Preview loaded independently, so the payload could occasionally send its message before MathLive was ready. The final carrier handled that race by retrying the same two messages for a limited period. A guard in the main page ensured that the private-conversation proof and outbound request ran only once.

Direct authenticated API access

Displaying an alert was the least interesting capability the exploit unlocked. The JavaScript was running as chatgpt.com, meaning it could interact with ChatGPT using the same authenticated context as the normal web application. The payload read session information already available to the page and used it to call ChatGPT's conversation APIs. It first enumerated the victim's recent conversations, then requested message data for a selected private conversation:

GET /backend-api/conversations?...&limit=20&order=updated&offset=0
GET /backend-api/conversations/?num_turns=2

This was direct authenticated API access, not scraping text visible on screen. The target conversation was unrelated to the malicious share and had never been shared with the attacker. Once the response was available, sending data off-site was straightforward: the payload created an ordinary image request to a server controlled by the researcher. Only a small piece of the response was sent off-site, but the injected code had already received the full authenticated conversation response and could read its contents.

The result was a practical cross-user data-theft primitive. A malicious public conversation could execute inside another user's signed-in ChatGPT session, enumerate private conversations, retrieve private message content, and send selected data to an attacker-controlled server. Because the code ran with the web application's authenticated access, its reach was not inherently limited to the conversation endpoints used in the proof. Other data and actions exposed through ChatGPT's authenticated frontend APIs sat inside the same security boundary. Essentially, any action on behalf of the victim's ChatGPT account became possible.

What went wrong and what OpenAI fixed

The Preview sandbox itself worked. Code inside Preview could not directly read the ChatGPT page. The problem was that another component in the main page was willing to accept its instructions. Three design decisions turned that mistake into a full exploit:

  • MathLive accepted a state-changing message without proving which frame sent it.
  • The message format allowed raw HTML to be supplied as keyboard-layout data.
  • That HTML could create an unsandboxed document that inherited the chatgpt.com identity.

The YouTube response was the final workaround for CSP, not the root cause. Blocking only that endpoint would have removed one path to JavaScript while still leaving an untrusted Preview able to insert HTML into ChatGPT.

OpenAI reproduced both the JavaScript execution and the private-conversation proof. The fix was rolled out across two versions of ChatGPT's web frontend. During the rollout, CSP changes blocked part of the original chain while one version still needed an update. On October 26, OpenAI confirmed that both versions now rejected the cross-frame MathLive messages used by the report and marked the issue resolved. A total bounty of $5,000 was awarded.

Timeline

October 13, 2026Confirmed the MathLive message-to-HTML path against ChatGPT's production code.
October 14Reproduced the chain through the normal UI and upgraded the fixed alert to arbitrary JavaScript.
October 16Confirmed public-share delivery between separate accounts and workspaces with one Preview click.
October 17Confirmed automatic Preview from share navigation and reproduced it after a hard refresh.
October 18Submitted the report to OpenAI's bug bounty program.
October 19Added the controlled private-chat disclosure proof.
October 21OpenAI reproduced the issue; severity was raised from the initial P2 triage to P1.
October 22OpenAI reported one web frontend fixed while the second was still being updated.
October 23CSP changes blocked part of the chain while one frontend update remained.
October 26OpenAI confirmed both frontends rejected the reported messages, resolved the issue, and awarded a total bounty of $5,000.

Defensive lessons

  • A message receiver should verify both the sender's web address and the exact window that was given permission.
  • Cross-window settings should not contain raw HTML.
  • Dynamically created documents should remain sandboxed when their content can be influenced by an untrusted frame.
  • CSP should be a backup control, not the only barrier after attacker-controlled HTML reaches the main site.

This bug was interesting because every individual feature looked reasonable on its own. Preview was isolated. Graphs could load a math keyboard. Frames could exchange messages. CSP allowed a major media provider. Public conversations could be shared. The vulnerability appeared only when all of those features were combined in one page.