跳到正文
Simon Willison·· 5 小时前精选AI 评分68

Parameter Labs 披露可接管 ChatGPT 账号的漏洞链

How We Took Over ChatGPT Accounts

AI 导读

Parameter Labs 披露了一条针对 ChatGPT HTML 预览沙箱的攻击链,可窃取已登录用户的私有数据或代其执行操作。攻击从 MathLive 虚拟键盘的 postMessage 接收代码使用 innerHTML 入手,在父页面注入无沙箱限制的 iframe,再借 CSP 白名单中的 YouTube oEmbed 端点反射执行 JavaScript。

推荐理由

这条漏洞链展示了沙箱 iframe、postMessage 与 CSP 白名单如何被逐层绕过,对理解前端隔离边界有参考价值。

正文 · 原文

31st October 2026 - Link Blog

How We Took Over ChatGPT Accounts (via) Parameter Labs describe an exploit they found against ChatGPT's implementation of the artifacts pattern (OpenAI used to call this "Canvas" but it looks like the latest revision is called HTML previews), where interactive custom HTML apps are displayed in a sandboxed iframe.

It's important that HTML in these stays tightly sandboxed to avoid untrusted code interacting with OpenAI APIs and accessing private data.

Parameter found quite a complex attack chain. OpenAI use the MathLive JavaScript library as part of their graph support, and that library includes its own virtual keyboard, which can be triggered in the parent page via postMessage() from the sandboxed iframe.

That message receiving code uses innerHTML, so anything that sends a message can add custom HTML to the parent - and there was no mechanism to prevent other sandboxed frames, including HTML preview frames, from calling that method.

This meant untrusted code in an iframe could insert HTML, and while innerHTML doesn't directly execute script elements it could be used to inject a new iframe without sandbox restrictions.

OpenAI’s CSP rules blocked inline scripts entirely, and only allowed script loading from a handful of domains, but one of those was YouTube - and the YouTube oEmbed endpoint could be used to reflect JavaScript back in a way that executed it.

Once the attack had JavaScript execution on ChatGPT, it was trivial to fetch private user data from APIs and exfiltrate it via an image reference.

The end result: you could create a ChatGPT share URL which, when visited by another signed-in user, could exfiltrate their private data or take actions on their behalf.

OpenAI closed the hole and paid out a $5,000 bug bounty, which I think was a bit cheap for a vulnerability this serious.

来源:Simon Willison · simonwillison.net