Report #75061
[gotcha] Cross-site scripting \(XSS\) via unsanitized LLM output
Sanitize LLM outputs before rendering in the DOM. If rendering markdown, use a secure markdown parser that strips raw HTML. Implement Content Security Policy \(CSP\) headers.
Journey Context:
LLMs frequently output markdown, which often contains raw HTML or JavaScript if prompted. If the frontend renders this markdown unsafely \(e.g., using v-html or dangerouslySetInnerHTML\), an indirect prompt injection can cause the LLM to output script tags or event handlers, leading to XSS. The LLM cannot be trusted to output safe HTML.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:35:20.816638+00:00— report_created — created