ChatGPT Vulnerability Allows Account Takeover via HTML Preview Exploit
Parameter Labs discovered a vulnerability in ChatGPT's HTML preview feature that allows malicious actors to bypass sandboxing and take over user accounts through a crafted link.
Exploit Mechanism and Vulnerability Discovery
Parameter Labs discovered an exploit mechanism in ChatGPT's implementation of the artifacts pattern, previously known as 'Canvas' and now referred to as HTML previews. This vulnerability allows interactive custom HTML apps to be displayed within a sandboxed iframe. By bypassing ChatGPT's sandbox and content security policy, the research team demonstrated that it was possible to take over any user's account by sending them a malicious link. The exploit was confirmed against ChatGPT's production code on October 13, 2026, as detailed in the research timeline provided by the team. This finding highlights the potential risks associated with the use of HTML previews in chat-based applications and underscores the importance of robust security measures in such implementations.
Security Flaws in ChatGPT's Implementation
Security flaws in ChatGPT's implementation have raised concerns about account takeover risks. One issue involves the handling of HTML content within sandboxed iframes, as noted by OpenAI itself, which emphasizes the need to keep such content tightly sandboxed to prevent untrusted code from interacting with OpenAI APIs and accessing private data. Additionally, the use of the MathLive JavaScript library introduces another potential vulnerability. This library includes a virtual keyboard that can be triggered via postMessage() from a sandboxed iframe, potentially allowing malicious actors to inject input into ChatGPT sessions. Furthermore, an oEmbed response was observed returning a JavaScript file with no Cross-Origin-Resource-Policy header, which could allow unauthorized access to embedded content. These findings highlight the importance of rigorous security practices in web-based AI interfaces.
Attack Execution and Impact
The attack execution leveraged a vulnerability in how ChatGPT handled message rendering, specifically through the use of innerHTML. As noted in Simon Willison, this method allowed untrusted code within an iframe to inject custom HTML into the parent frame, bypassing any restrictions meant to prevent such actions. Simon Willison further explains that while innerHTML does not directly execute script elements, it enabled the injection of new iframes without sandbox restrictions, effectively allowing malicious code to run in a trusted context. According to parameter.ai, the impact of this vulnerability was severe, as it permitted unauthorized access to ChatGPT's authenticated APIs, enabling attackers to take over victim accounts. This highlights the critical importance of secure coding practices when handling user-generated content and underscores the risks associated with improper iframe sandboxing.
Mitigation and Response from OpenAI
Following the discovery of vulnerabilities that allowed unauthorized access to ChatGPT accounts, OpenAI implemented several mitigation strategies. According to evidence, OpenAI’s Content Security Policy (CSP) rules initially blocked inline scripts entirely, permitting script loading only from a limited set of domains, one of which was YouTube. However, the YouTube oEmbed endpoint was exploited to reflect JavaScript back into the application, enabling unintended execution. In response, OpenAI confirmed on October 26 that both frontends rejected the reported messages, resolved the issue, and awarded a total bounty of $5,000. Prior to this, on October 23, CSP changes had partially blocked the attack chain, though one frontend update remained unresolved. These steps reflect OpenAI’s ongoing efforts to address security concerns and improve account protection mechanisms.
Timeline of the Vulnerability and Resolution
On October 16, users confirmed that public-share delivery between separate accounts and workspaces could be triggered with a single Preview click, as reported by parameter.ai. The following day, October 17, the same issue was confirmed to occur automatically through share navigation, and the behavior was successfully reproduced after a hard refresh, according to parameter.ai. By October 21, OpenAI had reproduced the issue and elevated its severity from the initial P2 triage to P1, as noted in parameter.ai. These findings highlight a critical vulnerability in the system's sharing mechanism, which allowed unauthorized access to content across accounts and workspaces. The timeline underscores the importance of rapid response and prioritization in addressing security concerns within AI platforms.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.