Parameter Labs published a chain that turned a shared ChatGPT artifact into script execution on the chatgpt.com origin. From there, an attacker could read a logged-in user’s private conversations and send them out through image requests. OpenAI has since fixed the issue and paid a $5,000 bug bounty. Simon Willison’s writeup is the clearest public account, and it is worth reading line by line if you ship anything that renders model output.
The interesting part is not any single bug. It is how four ordinary decisions composed into a full takeover.
Step one: a preview iframe that runs attacker HTML
Artifacts render generated HTML inside a sandboxed iframe. That is the correct default, and it is why the first step alone is harmless. The attacker’s page runs, but in an origin that cannot touch the parent document.
Step two: a component that trusts postMessage
The MathLive virtual keyboard listens for postMessage events to receive keystrokes and configuration from its host page. The handler did not sufficiently constrain the sender. So the sandboxed child could send a message that the parent treated as legitimate input.
This is the most common real-world version of the bug: a library that was designed for a trusted parent, later embedded in a page where the child is untrusted.
Step three: content written into the DOM as HTML
The parent wrote part of that message into the page with innerHTML rather than as text. That turned a data channel into an injection point, and the injected markup included an iframe without a sandbox attribute.
Step four: CSP allowed one script host
A strict Content Security Policy would have stopped the injected frame from loading script. But the policy allowlisted a YouTube oEmbed endpoint that reflects script content, which gave the attacker an allowlisted URL that would execute their code. Once that script ran, it ran as chatgpt.com, with access to the session and the conversation data.
Exfiltration used image requests, a classic channel that survives many output filters because it looks like ordinary page loading.
What to change in your own product
Four controls map directly onto the four steps. Keep previews cross-origin and sandboxed, with no allow-same-origin. Validate both origin and message shape on every postMessage handler, and treat any message from a preview as hostile. Never write message content with innerHTML; use textContent or a sanitizer with an explicit allowlist. Keep the CSP script allowlist minimal, and audit any endpoint you allow for reflected content.
Add one more: assume the model can be persuaded to emit hostile markup, because prompt injection makes that a realistic input rather than an edge case.
The bounty question
Five thousand dollars for a full account takeover on a product with ChatGPT’s reach is low by industry standards, and Willison says so. Bounty sizing is a policy choice, but it has a security consequence: it decides how many researchers keep looking. If your product renders untrusted HTML, price the bug class accordingly.
If you are testing agent output locally, run it in a client where you control the sandbox and can inspect what the page is loading. The Windows build is available at https://agent.aimoogh.com/download.
The takeaway
Every step in this chain was a reasonable local decision. Sandbox the preview, sure. Use a component that listens for messages, sure. Allow one trusted script host, sure. The failure was compositional, which is exactly the kind of failure that code review of individual diffs misses. Review the data flow across components, not just inside them.