LLM05: Improper Output Handling · 2025
LLM outputs reach browsers, databases, shells or other systems without validation, causing injection, SSRF or code execution.
Summary
LLM outputs reach browsers, databases, shells or other systems without validation, causing injection, SSRF or code execution.
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
- Treat every output as untrusted input.
- Apply contextual encoding and parameterized queries.
- Log and monitor anomalous patterns.
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.