# Parameter Labs details ChatGPT HTML preview flaw that could expose user data

> Parameter Labs describes an attack chain in ChatGPT's HTML previews that let a malicious share link reach other signed-in users' private data, which OpenAI has since closed.

- Status: reported (One outlet, not independently verified yet.)
- Topic: Safety & Security
- Published: 2026-10-31T23:15:22+00:00
- Updated: 2026-10-31T23:15:22+00:00
- Web page: https://ai-news.ikangai.com/story/parameter-labs-details-chatgpt-html-preview-flaw-that-could-expose-user-data/
- Seen in: Simon Willison
- Change: security (Security)
- Applies to: MathLive

## What changed

A crafted public ChatGPT share link could run JavaScript in the session of anyone who opened it and reach their private conversations, a flaw OpenAI has since fixed.

Parameter Labs has published details of an attack that let a crafted public ChatGPT share link run JavaScript inside the session of anyone who opened it. The script could access that user's private conversations. OpenAI fixed the flaw on October 26, classified it as P1, and paid a total bounty of $5,000. According to the researchers, the victim needed to do nothing more than open the link.

The chain started with two features that were reasonable on their own. ChatGPT's HTML Previews run generated code in a sandboxed frame on a separate web address, so that code cannot read the main chatgpt.com page. Parameter Labs found that a graph in the same conversation loads the MathLive library. MathLive installs a listener in the main page for messages about its on-screen virtual keyboard. Parameter says that listener accepted messages from any web address and did not check whether a message came from an approved window. Browsers let frames exchange messages through postMessage even when they cannot read each other's pages, so a Preview could send one.

The first message replaced the keyboard layout with attacker-supplied HTML, and the second told MathLive to show the keyboard. MathLive then assigned that markup to innerHTML. Parameter says a helper called createHTML appeared to sanitize the string, but it only marked the string as trusted and passed it through unchanged. Scripts inserted with innerHTML do not run on their own, so the researchers inserted an iframe using srcdoc without a sandbox attribute. Because the main page created that frame, the browser gave it the chatgpt.com identity, and it could reach the parent page.

The remaining obstacle was ChatGPT's Content Security Policy, which blocked inline scripts but allowed scripts from YouTube. Parameter says YouTube's oEmbed endpoint accepted a JSONP callback parameter and placed it into the response before returning its validation error. Ending the callback with ;void made the rest of the response harmless. The browser ran the result as a script because YouTube was an allowed source. The researchers call the CSP bypass a workaround rather than the root cause. They argue that blocking only that endpoint would have left an untrusted Preview able to insert HTML into ChatGPT.

The first working version was not a convincing real-world attack. It relied on a researcher-controlled ChatGPT App as the sender, which a victim would have had to connect to first. Sending the payload as a native HTML attachment also failed. Exporting the conversation as a public share kept the attachment but dropped the graph, and without the graph nothing in the main page was listening for the messages. The version that worked put a genuine graph and a later assistant-authored HTML Preview into one ordinary public conversation. In the most stable reproduction, the victim opened the share and clicked the Preview button once. Parameter later marked the HTML block as previewable so ChatGPT opened it automatically, and in that version the link was the only click. The researchers reproduced the automatic path three times in a separate account, with the alert appearing after roughly 4.5 seconds.

Showing an alert only proved that the code ran on chatgpt.com. Parameter says the payload then used session data already available to the page to call ChatGPT's backend conversation APIs. It listed the victim's 20 most recently updated conversations, then requested messages from a selected private conversation that had never been shared with the attacker. It sent only a small piece of the result out, using an image request to a server the researchers controlled. The researchers say the injected code could read the full response. They also say the same access could reach other data and account actions exposed through ChatGPT's authenticated frontend APIs.

Parameter Labs traces the bug to three design choices. A privileged listener trusted a message without verifying its sender. A message format allowed raw HTML as keyboard-layout data. A fresh document inherited the chatgpt.com origin. OpenAI reproduced both the code execution and the private-conversation proof, and fixed the issue across two versions of its web frontend. During rollout, CSP changes blocked part of the chain while one frontend still needed its update. On October 26, OpenAI confirmed that both versions rejected the cross-frame MathLive messages. The write-up doesn't say whether the flaw was exploited before the fix.

Simon Willison, who linked to the write-up, called the $5,000 bounty a bit cheap for a vulnerability this serious. On Hacker News, commenters on the same post also questioned the payout. One noted that the attack requires a user to click a link. The bounty timeline in the write-up shows the report was submitted on October 18. OpenAI raised its severity from an initial P2 to P1 on October 21.

## Why it matters

Any product that renders AI-generated HTML or third-party embeds can inherit the same class of risk when sandboxing or content security policies have gaps. The case shows that a single allowed script domain can undermine an otherwise strict policy.

## What you can do

Audit any AI-generated or user-shared HTML in your products for sandbox bypasses, restrictive content security policies, and postMessage handlers that write to innerHTML.

## Original source

- [Do the Math: How We Took Over ChatGPT Accounts - Parameter](https://www.parameter.ai/labs/we-found-a-gap-at-openai)
- [How We Took Over ChatGPT Accounts](https://simonwillison.net/2026/Oct/31/how-we-took-over-chatgpt-accounts/)

## Further reporting

- [Do the math: How we took over ChatGPT accounts | Hacker News](https://news.ycombinator.com/item?id=50314699)

---

AI wrote this summary from the sources listed, and nobody reviewed it individually before publication. Check the original source before you rely on it.

Cite as: IKANGAI AI News, "Parameter Labs details ChatGPT HTML preview flaw that could expose user data", 2026-10-31, https://ai-news.ikangai.com/story/parameter-labs-details-chatgpt-html-preview-flaw-that-could-expose-user-data/
