Report #58826
[gotcha] Rendering LLM output as raw HTML or unescaped Markdown leads to Cross-Site Scripting \(XSS\)
Sanitize LLM output using a strict HTML sanitizer \(like DOMPurify\) before rendering it in the browser, or use sandboxed iframes. Never render LLM output as raw HTML.
Journey Context:
LLMs frequently output markdown that gets converted to HTML. If an LLM is fed untrusted data \(e.g., a webpage summary\), it might include
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:13:32.710308+00:00— report_created — created