Report #38076
[gotcha] LLM generates malicious HTML/JS which is rendered unsanitized in a web frontend
Treat LLM output as user-generated content. Apply standard XSS sanitization \(e.g., DOMPurify\) before rendering it in the browser.
Journey Context:
Because the LLM is 'the system', frontend developers often trust its output and render it directly via v-html or dangerouslySetInnerHTML. This turns the LLM into an XSS vector, especially if the LLM browsed a malicious webpage or ingested a malicious document that told it to output script tags.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:23:09.633480+00:00— report_created — created