Data Exfiltration via Image Rendering Fixed in Amp Code
A vulnerability in Amp Code allowed an attacker to use markdown-driven image rendering to exfiltrate sensitive information from previous chat data. An attacker could host a prompt injection that asked the AI to render an image with chat data as a query parameter, sending it to a third-party site.
embracethered.com
Published on embracethered.com
In this post we discuss a vulnerability that was present in Amp Code from Sourcegraph by which an attacker could exploit markdown driven image rendering to exfiltrate sensitive information.
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 AI agent rendered markdown images without restricting outbound requests, allowing injected instructions to embed sensitive chat data in image URLs.
Impact
An attacker could exfiltrate sensitive information from previous chat data via image rendering.
What the attacker needed
Victim uses Amp Code; attacker hosts a prompt injection; AI processes the injected content
How it was found
- Host a prompt injection on a website that asks the AI to back up information to a third-party site.
- The injection instructs the AI to render an image and include previous chat data as a query parameter.
- The AI renders the image, sending the chat data to the third-party site.
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 an AI assistant reads a web page, that page can contain hidden instructions. Here, the page told the AI to create an image link that included earlier conversation details, and loading that image sent those details to the attacker's server. This is a way of stealing information through a normal feature like showing images.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.