OWASP Evolution

Improper Output HandlingLLM05: 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

LLM05 · How the attack worksGenerated output is inserted directly into the browser; untrusted HTML may execute code in the application’s origin.ModelHTML outputinnerHTMLBrowserUnvalidated output

Generated output is inserted directly into the browser; untrusted HTML may execute code in the application’s origin.

Example

Vulnerable · Pseudocode
answer = await llm(user_prompt)
panel.innerHTML = answer

Fix: 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

  1. 2025 · LLM05: Improper Output Handling Moves down to rank 10 in 2026
  2. 2026 · LLM10: Improper Output Handling Moves down from rank 5
  • 2025:LLM05 → 2026:LLM10: Improper Output Handling moves down from rank 5 to 10.

Sources

Buy me a coffee

OWASP Evolution

Editions
Continues / movesContinues RenamedRenamed Merged / expandedMerged