LLM10: Improper Output Handling · 2026
Using unvalidated outputs in systems or renderers causes injection, exfiltration or code execution, including insecure generated code.
Summary
Using unvalidated outputs in systems or renderers causes injection, exfiltration or code execution, including insecure generated code.
How the attack works
Generated output is inserted directly into the browser; untrusted HTML may execute code in the application’s origin.
Example
Vulnerable · Pseudocodeanswer = await llm(user_prompt)
panel.innerHTML = answerFix: Use textContent for text; if HTML is permitted, sanitize it and apply encoding for the destination context.
Prevention
- Validate and encode every output for its destination.
- Block external resources and disallowed control characters.
- Review and test generated code before executing it.
Lineage
- 2025 · LLM05: Improper Output Handling Moves down to rank 10 in 2026
- 2026 · LLM10: Improper Output Handling Moves down from rank 5
- 2025:LLM05 → 2026:LLM10: Improper Output Handling moves down from rank 5 to 10.