Why it matters

Model output is attacker-influenced input; passing it unchecked to a browser, shell, database or URL fetcher turns prompt injection into XSS, command injection, SQL injection or SSRF.

How to prevent it

  • Treat model output as untrusted: encode it for the rendering context and never execute it directly.
  • Replace free-form generated code, SQL or commands with narrow, parameterized operations that you validate.
  • Apply the same output encoding, Content Security Policy and parameterization you use for user input.

Guides on this site

Practice

References

  1. LLM05:2025 Improper Output Handling (OWASP, 2025 edition)
  2. OWASP Top 10 for LLM Applications 2026 (OWASP GenAI Security Project resource page)

List data from the publisher. A guide is listed as the main subject when the weakness or risk is what the guide is about, and as covering it when a dedicated section or worked example addresses it.