The OWASP LLM Top 10 groups security risks in applications built with large language models into categories. The list covers a range of areas, from processing inputs given to the model to the disclosure of sensitive information, and from passing model outputs to other systems to the permissions granted to the model to perform actions.
Risk categories in the list
The first risk on the OWASP list is called Prompt Injection. This vulnerability arises when a prompt changes the model's behavior or output in an unintended way. The second category, Sensitive Information Disclosure, concerns the disclosure of sensitive information such as personal information, financial information, and confidential business data.
The third category, Supply Chain, covers how vulnerabilities in the LLM supply chain can affect the integrity of training data, models, and deployment. The fourth category, Data and Model Poisoning, describes the modification of pre-training, fine-tuning, or embedding data in ways that introduce vulnerabilities, backdoors, or bias.
The fifth category, Improper Output Handling, concerns insufficient validation and sanitization of LLM outputs before they are passed to other components or systems. The sixth category, Excessive Agency, refers to an LLM application's ability to perform harmful actions in response to unexpected or modified outputs.
The other categories on the list are called System Prompt Leakage, Vector and Embedding Weaknesses, Misinformation, and Unbounded Consumption. OWASP associates System Prompt Leakage with the risk of system prompts or instructions being disclosed, and Vector and Embedding Weaknesses with security risks in systems that use Retrieval Augmented Generation (RAG) with LLMs. Misinformation covers models producing incorrect information.
Prompt Injection: Input changing behavior
The OWASP Gen AI Security Project distinguishes two routes of input for Prompt Injection. In direct injection, the user's prompt input changes the model's behavior unexpectedly. This input may have been crafted by an attacker, or it may be input the user provided without realizing it.
In indirect injection, the model receives input from an external source, such as a website or file. When the model interprets instructions in this content, its behavior may change in an unintended way. The content does not need to be visible or readable to a human; it is enough for the model to process it.
In one of OWASP's examples, an attacker modifies a document in a repository used by a RAG application. When the user's query retrieves the modified content, malicious instructions in the document affect the model's output and misleading results are produced. In another example, an instruction embedded in an image changes the model's behavior when the image and text are processed together.
The impact of a successful injection depends on the application's business context and the scope of action given to the model. Possible consequences include the disclosure of sensitive information or system prompts, modification of outputs, unauthorized access to functions the model can access, and execution of commands in connected systems.
To reduce the impact, OWASP recommends specifying the model's role, capabilities, and limits in the system prompt. The expected output format can be clearly defined, and compliance with that format can be verified with deterministic code. Untrusted external content can also be separated from the user's prompt and clearly marked.
Permission control is another step. OWASP recommends that the application use its own API tokens for extended functions, that these functions be managed in code instead of being given to the model, and that the model's access be limited to the minimum necessary permissions. Human approval for privileged actions and regular attack testing to test trust boundaries are also among the recommendations.
Sensitive Information Disclosure: Disclosure of sensitive data
According to OWASP, sensitive information can include personally identifiable information (PII), financial details, health records, confidential business data, security credentials, and legal documents. LLM applications can disclose this information through their outputs. Possible consequences include unauthorized data access, privacy violations, and intellectual property infringement.
OWASP's explanation of sensitive information disclosure states that users may unintentionally provide sensitive information to the model and that this information may later appear in model output. In one of OWASP's example scenarios, insufficient data sanitization leads to a user receiving a response containing another user's personal data.