Generated banner for Owasp LLM
Generated logo for Owasp LLM

Owasp LLM

MicrosoftOfficialPublished by Microsoft

  • Skill
  • Guidelines
  • Security
  • CC-BY-SA-4.0
  • No issues found

From the author

OWASP Top 10 for LLM Applications (2025) knowledge base for identifying, assessing, and remediating large language model security risks.
— the description by Microsoft

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The owasp-llm skill provides a machine-readable implementation of the OWASP Top 10 for LLM Applications (2025). It serves as a comprehensive reference for developers and security professionals to understand, detect, and mitigate vulnerabilities inherent in large language model systems. Each of the ten identified risks is documented with detailed descriptions, risk assessments, vulnerability checklists, and actionable prevention and remediation strategies.

What it does

  • Provides a structured index of the 2025 OWASP LLM Top 10 vulnerabilities.
  • Offers detailed breakdowns for each vulnerability, including risk impact and attack scenarios.
  • Includes specific vulnerability checklists to help identify system exposure.
  • Supplies defensive measures and remediation guidance for each security risk.
  • Categorizes risks into logical groups like Input Integrity, Data Protection, and Access Control.

When to use it

  • During the design phase of an LLM-integrated application to implement security by design.
  • When performing a security audit or risk assessment of an existing LLM system.
  • To train development teams on common LLM-specific security threats.
  • When developing remediation plans for identified security vulnerabilities in AI workflows.

Advantages

  • Standardized, industry-recognized framework for LLM security.
  • Machine-readable format suitable for integration into automated security agents.
  • Covers both direct and indirect attack vectors, including multimodal risks.
  • Provides clear, actionable steps for both detection and long-term remediation.

Usage examples

“What are the primary risks associated with Prompt Injection according to the OWASP LLM Top 10?”
The agent retrieves the LLM01:2025 documentation, detailing direct and indirect injection risks, potential consequences like data exfiltration, and a checklist for identifying exposure.
“How can I prevent Excessive Agency in my LLM agent?”
The agent references LLM06:2025, providing guidance on enforcing least privilege, implementing human-in-the-loop requirements for high-risk actions, and defining strict capability boundaries.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/microsoft/owasp-llm/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip owasp-llm.zip -d .agents/skills

Documentation by Microsoft

OWASP® LLM Top 10 — Skill Entry

This SKILL.md is the entrypoint for the OWASP LLM Top 10 skill.

The skill encodes the OWASP Top 10 for LLM Applications (2025) as structured, machine-readable references that an agent can query to identify, assess, and remediate security risks in large language model systems.

Normative references (LLM Top 10)

  1. 00 Vulnerability Index

  2. 01 Prompt Injection

  3. 02 Sensitive Information Disclosure

  4. 03 Supply Chain

  5. 04 Data and Model Poisoning

  6. 05 Improper Output Handling

  7. 06 Excessive Agency

  8. 07 System Prompt Leakage

  9. 08 Vector and Embedding Weaknesses

  10. 09 Misinformation

  11. 10 Unbounded Consumption

Skill layout

  • SKILL.md — this file (skill entrypoint).

  • references/ — the LLM Top 10 normative documents.

    • 00-vulnerability-index.md — index of all vulnerability identifiers, categories, and cross-references.

    • 01 through 10 — one document per vulnerability aligned with OWASP LLM Applications numbering.

Third-Party Attribution

Copyright © OWASP Foundation. OWASP® Top 10 for LLM Applications (2025) content is derived from works by the OWASP Foundation, licensed under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/). Source: https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/ Modifications: Vulnerability descriptions restructured into agent-consumable reference documents with added detection and remediation guidance. OWASP® is a registered trademark of the OWASP Foundation. Use does not imply endorsement.

Files

references/05-improper-output-handling.md


title: 'LLM05: Improper Output Handling' description: OWASP LLM Top 10 reference for improper output handling vulnerabilities including injection via LLM-generated content

05 Improper Output Handling

Identifier: LLM05:2025 Category: Output Safety

Description

Improper Output Handling refers to insufficient validation, sanitization, and handling of the outputs generated by large language models before they are passed downstream to other components and systems. Since LLM-generated content can be controlled by prompt input, this behavior is similar to providing users indirect access to additional functionality.

Improper Output Handling differs from Overreliance in that it deals with LLM-generated outputs before they are passed downstream whereas Overreliance focuses on broader concerns around overdependence on the accuracy and appropriateness of LLM outputs.

Successful exploitation can result in XSS and CSRF in web browsers, SSRF, privilege escalation, or remote code execution on backend systems.

The following conditions increase the impact of this vulnerability: granting the LLM privileges beyond what is intended for end users, vulnerability to indirect prompt injection attacks, third-party extensions that do not adequately validate inputs, lack of proper output encoding for different contexts, insufficient monitoring and logging of LLM outputs, and absence of rate limiting or anomaly detection for LLM usage.

Risk

  • Cross-site scripting (XSS) and CSRF in web browsers from unescaped LLM-generated content.

  • Server-side request forgery (SSRF) through unvalidated output used in server requests.

  • Privilege escalation through LLM capabilities exceeding intended end user access.

  • Remote code execution on backend systems via output passed to system shells or eval functions.

  • SQL injection through unparameterized LLM-generated queries executed against databases.

  • Path traversal through unsanitized file path construction from LLM output.

  • Phishing attacks through unescaped LLM-generated content used in email templates.

  • Insecure code generation leading to vulnerabilities when developers integrate unverified LLM code suggestions.

Vulnerability checklist

  • LLM output is entered directly into system shells or functions such as exec or eval without validation.

  • JavaScript or Markdown generated by the LLM is returned to users and interpreted by the browser without encoding.

  • LLM-generated SQL queries are executed without proper parameterization.

  • LLM output is used to construct file paths without proper sanitization.

  • LLM-generated content is used in email templates without proper escaping.

  • The application grants the LLM privileges beyond what is intended for end users.

  • Third-party extensions do not adequately validate LLM-generated inputs.

  • No proper output encoding is applied for different downstream contexts such as HTML, JavaScript, or SQL.

  • Monitoring and logging of LLM outputs is insufficient to detect exploitation attempts.

  • No Content Security Policy is in place to mitigate XSS from LLM-generated content.

Prevention controls

  1. Treat the model as any other user, adopting a zero-trust approach, and apply proper input validation on responses coming from the model to backend functions.

  2. Follow the OWASP ASVS (Application Security Verification Standard) guidelines to ensure effective input validation and sanitization.

  3. Encode model output back to users to mitigate undesired code execution by JavaScript or Markdown. OWASP ASVS provides detailed guidance on output encoding.

  4. Implement context-aware output encoding based on where the LLM output will be used, such as HTML encoding for web content and SQL escaping for database queries.

  5. Use parameterized queries or prepared statements for all database operations involving LLM output.

  6. Employ strict Content Security Policies (CSP) to mitigate the risk of XSS attacks from LLM-generated content.

  7. Implement robust logging and monitoring systems to detect unusual patterns in LLM outputs that might indicate exploitation attempts.

Example attack scenarios

Scenario A — Extension shutdown via unvalidated output

An application utilizes an LLM extension to generate responses for a chatbot feature. The extension also offers administrative functions accessible to another privileged LLM. The general purpose LLM directly passes its response without proper output validation to the extension, causing the extension to shut down for maintenance.

Scenario B — Data exfiltration via summarizer

A user utilizes a website summarizer tool powered by an LLM to generate a concise summary of an article. The website includes a prompt injection instructing the LLM to capture sensitive content from either the website or from the user's conversation. The LLM encodes the sensitive data and sends it without any output validation or filtering to an attacker-controlled server.

Scenario C — SQL execution via chat

An LLM allows users to craft SQL queries for a backend database through a chat-like feature. A user requests a query to delete all database tables. If the crafted query from the LLM is not scrutinized, all database tables are deleted.

Scenario D — XSS via unsanitized content

A web app uses an LLM to generate content from user text prompts without output sanitization. An attacker submits a crafted prompt causing the LLM to return an unsanitized JavaScript payload, leading to XSS when rendered on a victim's browser.

Scenario E — Malicious email template injection

An LLM is used to generate dynamic email templates for a marketing campaign. An attacker manipulates the LLM to include malicious JavaScript within the email content. If the application does not properly sanitize the LLM output, this leads to XSS attacks on recipients who view the email in vulnerable email clients.

Scenario F — Insecure code generation

An LLM is used to generate code from natural language inputs in a software company. The approach risks exposing sensitive information, creating insecure data handling methods, or introducing vulnerabilities like SQL injection. The AI may also hallucinate non-existent software packages, potentially leading developers to download malware-infected resources.

Detection guidance

  • Review code for direct use of LLM output in system commands, SQL queries, or file path construction.

  • Test for XSS by examining LLM-generated content rendered in browsers for unescaped JavaScript or Markdown.

  • Inspect Content Security Policies for adequacy against LLM-generated content injection.

  • Monitor logging systems for unusual patterns in LLM outputs indicating exploitation attempts.

  • Check all database operations involving LLM output for parameterized query usage.

  • Audit third-party extensions for adequate input validation of LLM-generated content.

Remediation

  • Replace all direct use of LLM output in system commands with properly validated and sanitized alternatives.

  • Implement context-aware output encoding for all LLM output based on the downstream consumer.

  • Replace all unparameterized queries involving LLM output with parameterized queries or prepared statements.

  • Deploy strict Content Security Policies to mitigate XSS from LLM-generated content.

  • Add robust logging and monitoring to detect and respond to exploitation attempts in LLM outputs.

  • Conduct thorough code review and verification of all LLM-suggested packages and code before integration.


Content derived from works by the OWASP Foundation, licensed under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/). Modifications: Restructured into agent-consumable reference format with added detection and remediation guidance.

Requirements and compatibility

Written for: GitHub Copilot, Claude Code

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Claude Code frontmatter

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Microsoft
Publisher
Microsoft (Official)
Source
microsoft/hve-core · .github/skills/security/owasp-llm · commit f425e94
Licence
Creative Commons Attribution-ShareAlike 4.0 International (redistribution allowed)
  • LICENSE (written by AutoGineer)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download owasp-llm.zip