CHATGPT: A Potential Phishing Vector via HTML Injection
ChatGPT rendered SVG and image tags stored inside code blocks directly into the page when a chat was reopened or shared, instead of showing them as text. An attacker could use this to embed clickable phishing messages, flashing animations, or content that crashes the browser.
medium.com
Published on medium.com
While experimenting with GPT, I discovered that ChatGPT allows storing <svg> and <img> tags inside code blocks, and these elements are rendered when the chat is reopened or shared via a link. (Link sharing was later disabled after the vulnerability was reported.)
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the chat interface failed to treat code-block content as inert text and instead inserted SVG and image markup into the page's HTML.
Impact
An attacker could craft a shared chat that displays deceptive clickable messages or flashing animations, potentially phishing users or causing discomfort; link sharing was later disabled, limiting the attack.
What the attacker needed
A ChatGPT account; victim opens a shared chat link
The fix
The rendering should treat code-block content as text so that SVG and image tags are never inserted into the page; link sharing was disabled after the report.
How it was found
- Ask GPT to produce SVG or image tags inside a code block.
- Reopen the chat or share it via a public link.
- Observe that the tags are rendered as live elements rather than shown as text.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you paste code into ChatGPT, it normally shows it as plain text inside a box. Here, if the code contained certain picture-drawing tags, ChatGPT displayed them as real images on the page. That let an attacker make a shared chat look like it contained a clickable link or a flashing warning, which could trick people.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.