Report #39021
[gotcha] LLM outputs markdown image links that exfiltrate chat history
Sanitize all LLM outputs before rendering in the UI. Strip markdown image syntax or route all external image requests through a secure proxy that drops query parameters. Enforce strict Content Security Policy \(CSP\) in the chat UI.
Journey Context:
Security efforts focus on preventing the LLM from generating bad text, but ignore how the UI renders it. An attacker uses indirect injection to force the LLM to output an image tag pointing to their server with the chat history in the URL. When the user's browser renders the markdown, it automatically fetches the URL, sending the sensitive data to the attacker. Output sanitization is mandatory because LLMs cannot be perfectly secured against indirect injection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:58:20.513776+00:00— report_created — created