Report #80689
[gotcha] Cross-Site Scripting \(XSS\) via unsanitized LLM outputs
Always sanitize LLM outputs for XSS before rendering in the DOM, treating the LLM as an untrusted entity, exactly like you would treat a public comment form.
Journey Context:
Because the LLM generates the text, developers mistakenly treat it as trusted application output. However, if an attacker uses indirect prompt injection \(e.g., on a webpage the LLM reads\), they can force the LLM to output alert\(1\). If the frontend renders this unsanitized, it results in XSS.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T18:02:47.106796+00:00— report_created — created