#21
Chat replies can send private content to an attacker through Markdown images
Summary
The agent's chat replies are shown as Markdown, and Markdown can load images from any website. There is no Content Security Policy on the app, so nothing stops those images from loading. A web page the agent reads can tell it to write an image link that carries the user's private chat content to an attacker's server, with no click needed.
What goes wrong
- The agent has
web_fetchand web search, so it reads pages that anyone can write. - Its replies are drawn with
<ReactMarkdown>(components/markdown.tsx, used fromcomponents/thread.tsx). By default it turnsinto a real<img>. - fx0 sends no
Content-Security-Policyon the app itself.next.config.mjssets no headers, and there is noproxy.tsormiddleware.ts. - A malicious page can tell the model to end its reply with an image link whose address contains the user's earlier messages. If the model follows it, the browser requests that address as soon as the reply streams in, and the attacker's server gets the data in the URL.
The design preview is well protected: sandboxed frame, CSP, connect-src 'none'. The chat transcript has none of that.
How I checked
- I read the render path and searched the repo for any CSP, header config, proxy or middleware. There is none for the app origin.
- I have not run this end to end against a live deployment. The behaviour comes from
react-markdown's default of rendering remote images, so it's worth confirming in a browser.
Why the tests didn't catch it
The CSP tests only cover the design frame and the image and export routes. Nothing checks what the chat text can load.
Impact
- Anything in the model's context can leave the browser: the user's prompts, an uploaded
DESIGN.md, earlier fetched pages, the design HTML. - It needs only that the agent reads one hostile page, such as a search result or a link the user pasted.
- No credentials are in the context, so this is a privacy leak, not an account takeover.
Activity
0No activity yet.