ChatGPT share link could run attacker code in a victim's session

A research team publishing on parameter.ai says that in October 2026 it found a chain of flaws that turned an ordinary public ChatGPT share into attacker-controlled JavaScript running inside the signed-in session of whoever opened it. An attacker creates a malicious conversation, publishes it with ChatGPT's normal sharing feature and sends the link. When the victim opens it, the payload runs as chatgpt.com with access to the victim's authenticated web session. The authors say they confirmed the code could list the victim's conversations, fetch a private conversation that had never been shared with the attacker, and send data from it to an external server. No App, Project, pasted code or developer tools were needed; opening the link was the only required action. OpenAI fixed the issue on October 26 and classified the report as P1.
The chain began with two features that looked harmless alone: an interactive graph and the HTML Preview. ChatGPT runs Preview code in a restricted frame on a different web address, and the authors confirm this isolation worked: code in the Preview could not read parent.document. But the graph loaded a math library called MathLive, which installed a listener in the main ChatGPT page for messages about its on-screen keyboard. The browser's postMessage API lets frames exchange messages even when they cannot read each other's pages, and it is safe only if the receiver checks who sent the message. MathLive did not check for the setting the authors targeted: its top-level controller used an origin policy of none, so it accepted messages from any web address, and it did not require the update-setting message to come from a previously approved window.
The Preview sent two messages. The first replaced the virtual keyboard layout with the authors' HTML; the second told MathLive to show the keyboard. MathLive joined the layout into an HTML string and assigned it to innerHTML in the real ChatGPT page. A helper called createHTML looked as if it might sanitize the value, but it marked the string as trusted and passed the HTML through unchanged. Script tags inserted through innerHTML do not run, so the authors injected an iframe with a srcdoc attribute. MathLive added that frame to the main document without a sandbox attribute, so the new document got the https://chatgpt.com identity and could reach the parent page.
ChatGPT's Content Security Policy (CSP) blocked inline JavaScript but allowed scripts from YouTube. YouTube's oEmbed endpoint supported a JSONP-style callback parameter and, when it rejected an invalid callback, still placed that callback into the response before returning its validation error. By ending their callback with ;void, the authors made the object YouTube appended harmless. The browser loaded the response as a script, and the callback ran in the new frame: arbitrary JavaScript as chatgpt.com. The authors stress that the YouTube trick was the final CSP workaround, not the root cause; blocking only that endpoint would still have left an untrusted Preview able to insert HTML into ChatGPT.
Getting from a lab bug to one public link took several steps. The first working version used a researcher-controlled ChatGPT App as the sender, so a victim would have had to connect or invoke that App. A native HTML attachment opened in the same sandboxed Preview and could send the messages, but exporting the conversation as a public share kept the attachment and dropped the earlier graph, so nothing was listening. The breakthrough was putting both pieces into one ordinary public conversation: a genuine graph to initialize MathLive in the main page, and a later assistant-authored HTML Preview to send the two messages. The resulting /share/
The authors saw two versions of the interaction. In the most stable reproduction the victim opened the share and clicked ChatGPT's normal Preview button once. After the authors marked the HTML block as previewable, ChatGPT opened it automatically and opening the link was the only click. They reproduced that automatic path three times in a separate account, including after a hard refresh, with the alert appearing after roughly 4.5 seconds. Because the graph and Preview load independently, the payload sometimes fired before MathLive was ready, so the final carrier retried the same two messages for a limited period, and a guard made the private-conversation proof and outbound request run only once.
An alert was only proof of where the code ran. The payload read session information already available to the page and called ChatGPT's authenticated APIs directly: first GET /backend-api/conversations with limit=20&order=updated&offset=0 to list recent conversations, then GET /backend-api/conversations/
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 rejected the cross-frame MathLive messages used in the report and marked the issue resolved.
The authors name three design decisions that made the exploit work: MathLive accepted a state-changing message without proving which frame sent it; the message format allowed raw HTML as keyboard-layout data; and that HTML could create an unsandboxed document inheriting the chatgpt.com identity. Their closing point is that every feature looked reasonable on its own (isolated Preview, a graph that loads a math keyboard, frames that exchange messages, CSP that allows a major media provider, shareable public conversations), and the vulnerability appeared only when all of them were combined in one page.
Key facts
- A malicious public ChatGPT share could run attacker JavaScript as chatgpt.com in the signed-in session of anyone who opened it, according to the research team on parameter.ai.
- The chain used MathLive's postMessage listener (origin policy of none, no check on the sending window), an unsanitized innerHTML assignment, an unsandboxed srcdoc iframe, and a CSP bypass through YouTube's oEmbed JSONP callback.
- The authors confirmed the code could list a victim's conversations, fetch a private conversation never shared with the attacker, and send data to an external server; they say they could perform any action on the victim's account.
- In the most stable reproduction the victim clicked Preview once; with the HTML block marked previewable, ChatGPT opened it automatically and opening the link was the only click, reproduced three times with the alert after roughly 4.5 seconds.
- OpenAI reproduced the issue, classified the report as P1, rolled the fix out across two web frontend versions and marked it resolved on October 26.
Why it matters
The attack needed nothing from the victim except opening a public ChatGPT share link, a thing people routinely do with links sent by email, chat, support tickets or social posts. According to the authors, the injected script ran as chatgpt.com with the victim's authenticated access, so it could read private conversations that had never been shared and, in their words, perform any action on the victim's account. The write-up also shows how a sandbox that works as designed can be bypassed: the Preview stayed isolated, but a trusted component in the main page (MathLive) agreed to act on messages from an untrusted frame and created a new unsandboxed document.
Who it affects
By the authors' account, anyone who opened a malicious public share link in a signed-in ChatGPT web session was exposed before the fix. The victim did not have to install an App, join a Project, paste code or open developer tools. The lessons also apply to web developers who embed third-party components, handle cross-window messages, build iframes dynamically or rely on a CSP that allows a large provider such as YouTube. The source does not give the number of affected users or accounts.
How to use it
OpenAI fixed the issue on October 26, so there is no action the source asks of ChatGPT users. For developers, the authors list four 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 stay sandboxed when an untrusted frame can influence their content; and CSP should be a backup control, not the only barrier once attacker-controlled HTML reaches the main site.
How solid is it
The account comes from the researchers' own write-up on parameter.ai, which names no individual authors and includes no OpenAI statement or quote. The technical walkthrough is detailed: specific message flow, the createHTML pass-through, the srcdoc iframe without a sandbox attribute, the YouTube callback behaviour and the two API requests used. The authors say OpenAI reproduced both the JavaScript execution and the private-conversation proof, and that OpenAI classified the report as P1 and confirmed the fix on October 26. The automatic path was reproduced three times in a separate account. Those details about OpenAI's actions are reported by the authors, not by OpenAI.
Risks and caveats
The source states no evidence of exploitation in the wild; it describes only the authors' own proof of concept, in which they deliberately sent a small piece of one response off-site. The claim that any action on a victim's account was possible is the authors' inference from the code running with authenticated access, not a list of actions they demonstrated. The source does not say whether MathLive itself has been patched or whether YouTube changed the oEmbed callback behaviour. It gives no CVE identifier or bounty amount. During the rollout, the authors say, CSP changes blocked part of the original chain while one frontend version still needed an update, before OpenAI confirmed both versions were fixed.
“CSP should be a backup control, not the only barrier after attacker-controlled HTML reaches the main site.”
— parameter.ai research team, in its write-up