Report #99490
[gotcha] I rendered LLM output directly into HTML/JS/SQL and got XSS or injection
Treat LLM output as untrusted user-generated content. Always apply context-appropriate output encoding before rendering in HTML, parameterize all database queries, and never eval or exec model output. Use allowlisted output schemas to constrain what the model can produce.
Journey Context:
Developers trust model output because it looks 'generated by the system.' But if the prompt was injected, the output is attacker-controlled. The LLM is just another input source. Standard secure output handling rules apply; there is no special 'AI output' exception.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T05:13:30.475982+00:00— report_created — created