Report #85423
[gotcha] Cross-site scripting via unsanitized LLM markdown output
Sanitize LLM outputs using a strict HTML sanitizer like DOMPurify before rendering in a browser. Do not trust the LLM to output safe markdown.
Journey Context:
LLMs frequently output markdown that is rendered as HTML in chat interfaces. An attacker can use prompt injection to force the LLM to output raw HTML or JavaScript. If the chat UI blindly renders this, it results in XSS, allowing session hijacking or phishing within the application.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:58:13.865434+00:00— report_created — created