OWASP Top 10 for LLM Applications 2025

Insecure Output Handling

Failing to validate LLM output leading to XSS or code execution.

What is Insecure Output Handling?

Insecure Output Handling occurs when an application blindly accepts the output of an LLM and passes it directly to a backend system or renders it in the browser without validation or sanitization.

Since LLMs can be manipulated (via prompt injection) to generate malicious content, treating their output as trusted can lead to:

  • Cross-Site Scripting (XSS): The model generates JavaScript that executes in the user's browser.
  • Server-Side Request Forgery (SSRF): The model generates URLs that the backend fetches.
  • Code Execution: The model generates shell commands that are executed by the server.