Insecure output handling occurs when generated model content is directly trusted by applications, users, or downstream systems. Attackers can weaponize outputs into code injection, unsafe rendering, or misleading instructions that trigger harmful operations. The vulnerability is not only model correctness but the unsafe assumptions made by consuming components.
Treat model output as untrusted input and enforce strict validation before rendering, storing, or executing it. Use contextual escaping, schema validation, and policy classifiers for high-risk content. For action-taking workflows, require deterministic checks and optional human approval before execution.
The same feature written the risky way, then with the fix applied.
How this risk has ranked in each OWASP release.
2024Latest
#02llm02-2024 Insecure Output Handling