OWASP Top 10 For LLMs 2023 Slides v09

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

OWASP Top2 0 210

3
for LLM
| OWASP Top 10 for LLM

OWASP Top 10 for LLM


LLM02 LLM03 LLM04 LLM05
LLM01

Prompt Injection Insecure Output


Training Data
Model Denial of
Supply Chain
Handling Poisoning Service Vulnerabilities
This manipulates a large language
model (LLM) through crafty inputs, This vulnerability occurs when an LLM This occurs when LLM training data is Attackers cause resource-heavy LLM application lifecycle can be
causing unintended actions by the LLM. output is accepted without scrutiny, tampered, introducing vulnerabilities or operations on LLMs, leading to service compromised by vulnerable
Direct injections overwrite system exposing backend systems. Misuse biases that compromise security, degradation or high costs. The components or services, leading to
prompts, while indirect ones manipulate may lead to severe consequences like effectiveness, or ethical behavior. vulnerability is magnified due to the security attacks. Using third-party
inputs from external sources. XSS, CSRF, SSRF, privilege escalation, or Sources include Common Crawl, resource-intensive nature of LLMs and datasets, pre- trained models, and
remote code execution. WebText, OpenWebText, & books. unpredictability of user inputs. plugins add vulnerabilities.

LLM06 LLM07 LLM08 LLM09 LLM10

Sensitive Information Insecure Plugin


Excessive Agency Overreliance Model Theft
Disclosure Design
LLM-based systems may undertake Systems or people overly depending on This involves unauthorized access,
LLM’s may inadvertently reveal LLM plugins can have insecure inputs actions leading to unintended LLMs without oversight may face copying, or exfiltration of proprietary
confidential data in its responses, and insufficient access control due to consequences. The issue arises from misinformation, miscommunication, LLM models. The impact includes
leading to unauthorized data access, lack of application control. Attackers excessive functionality, permissions, or legal issues, and security vulnerabilities economic losses, compromised
privacy violations, and security can exploit these vulnerabilities, autonomy granted to the LLM-based due to incorrect or inappropriate content competitive advantage, and potential
breaches. Implement data sanitization resulting in severe consequences like systems. generated by LLMs. access to sensitive information.
and strict user policies to mitigate this. remote code execution.
| OWASP Top 10 for LLM

EXAMPLES
LLM01
Attackers instruct LLM to return private information
Hidden prompt injection in a webpage solicits sensitive information

Prompt Injection A document with a prompt injection manipulates LLM's output


Rogue instruction on a website exploits a plugin, causing unauthorized
actions.
Prompt Injection allows attackers to
PREVENTION
manipulate Large Language Models
Restrict LLM's access to necessary operations
(LLMs) through crafted inputs, leading to Require user approval for privileged operations

potential backend system exploitation or Limit untrusted content's influence on user prompts
Establish trust boundaries and maintain user control.
user interaction manipulation.
ATTACK SCENARIOS

Adversarial prompt injection on a website causes unauthorized actions


Hidden prompt injection in a resume manipulates LLM's output
Direct prompt injection allows malicious user control over the LLM.
| OWASP Top 10 for LLM

EXAMPLES
LLM02
LLM output directly entered into a backend function, causing remote
code execution

Insecure Output JavaScript or Markdown generated by the LLM is interpreted by the


browser, resulting in XSS.

Handling PREVENTION

Apply input validation on responses from the model to backend functions


Insecure Output Handling vulnerability Encode output from the model back to users to mitigate undesired code
interpretations.
occurs when a plugin or application
accepts LLM output without scrutiny and ATTACK SCENARIOS

passes it to backend or client-side Application passes LLM-generated response into an internal function
without validation, leading to unauthorized access or modifications
functions. This can lead to XSS, CSRF, A website summarizer tool powered by an LLM captures sensitive content

SSRF, privilege escalation, or remote code and sends it to an attacker-controlled server


An LLM allows users to craft SQL queries for a backend database without
execution. scrutiny, leading to potential data loss
A malicious user instructs the LLM to return a JavaScript payload back to
a user, causing unsanitized XSS payload execution.
| OWASP Top 10 for LLM

EXAMPLES
LLM03

Malicious influence on model outputs via targeted, inaccurate

documents

Model training using unverified data

Training Data Unrestricted dataset access by models leading to control loss.

Poisoning P R E V E NT I O N

Verify training data supply chain and data source legitimacy

This happens when an attacker Employ dedicated models per use-case

Implement sandboxing, input filters, adversarial robustness


manipulates the training data or fine-
Detect poisoning attacks via loss measurement and model analysis.

tuning procedures of an LLM, introducing


AT TAC K S C E N A R I O S
vulnerabilities, backdoors, or biases that
Misleading LLM outputs result in biased opinions or hate crimes
compromise the model’s security, Injection of toxic data by malicious users

Competitor manipulation of model's training data.


effectiveness, or ethical behavior. This

can impact model performance, user

trust, and brand reputation.


| OWASP Top 10 for LLM

EXAMPLES
LLM04
High-volume task generation through specific queries
Unusually resource-consuming queries

Model Denial of Continuous input overflow exceeding the LLM's context window
Repeated long inputs or variable-length input floods.

Service PREVENTION

Implement input validation and sanitization


Model Denial of Service involves Cap resource use per request
Enforce API rate limits
excessive resource consumption by an Monitor LLM resource utilization
attacker's interaction with an LLM, leading Set strict input limits based on the LLM’s context window
Promote developer awareness about potential DoS vulnerabilities.
to service quality decline and potential
cost increases. ATTACK SCENARIOS

Repeated requests to a hosted model, worsening service for other users


Text on a webpage causing excessive web page requests
Continuous input overflow or sequential inputs exhausting the context
window
Recursive context expansion or variable-length input floods.
| OWASP Top 10 for LLM

EXAMPLES
LLM05
Use of vulnerable third-party components or base images
Use of a tampered pre-built model for fine-tuning

Supply Chain Use of poisoned external data sets for fine-tuning.

Vulnerabilities PREVENTION

Vet data sources and suppliers, including their T&Cs and privacy policies
Use reputable plug-ins and ensure they have been tested for your
Supply-chain vulnerabilities can impact application requirements
Maintain an up-to-date inventory of components using a Software Bill of
the entire lifecycle of LLM applications, Materials (SBOM).
including third-party libraries/packages,
ATTACK SCENARIOS
docker containers, base images, and
Exploitation of a vulnerable or outdated package or base image
service suppliers. These vulnerabilities Exploitation of a malicious or vulnerable ChatGPT plugin
can lead to cyber-attacks, data disclosure, Exploitation of an outdated or deprecated model with vulnerabilities.

and tampering.
| OWASP Top 10 for LLM

EXAMPLES
LLM06
Malicious manipulation of model's training data
Training models using unverified data

Sensitive Information Unrestricted model access to datasets.

Disclosure PREVENTION

Utilize data sanitization and robust input validation


Implement least privilege principle during fine-tuning
Sensitive Information Disclosure in LLMs Limit and control access to external data sources.

refers to unintentional exposure of ATTACK SCENARIOS


confidential details, including algorithms Inadvertent user exposure to other user data via the LLM
and user data, through system responses. Bypassing input filters to trick LLM into leaking sensitive data
Personal data leakage via training data.
This can lead to unauthorized access,
privacy infringements, and other security
breaches.
| OWASP Top 10 for LLM

EXAMPLES
LLM07
Plugins accepting undifferentiated parameters
Plugins taking URL strings instead of query parameters

Insecure Plugin Plugins permitting raw SQL queries


Lack of distinct authorizations for chained plugins.

Design PREVENTION

Enforce parameterized input with type and range checks


Insecure LLM plugin design results in Apply OWASP’s recommendations for input validation
Utilize least-privilege access control
vulnerabilities due to insecure inputs and Use robust authentication like Oauth2
insufficient access control. Plugin Require user confirmation for sensitive plugins' actions.

integration APIs could permit free text ATTACK SCENARIOS


inputs without validation, enabling Malicious URL redirection for reconnaissance or content injection
potential malicious requests. Exploitation of non-validated free-form input to perform harmful actions
Unauthorized access through manipulation of configuration parameters
Misconfigurations and poor access SQL attacks via advanced filters
Unsanctioned actions through insecure plugins.
controls can have consequences.
| OWASP Top 10 for LLM

EXAMPLES
LLM08

Unnecessary or high-privilege plugin functions accessible to LLM

Lack of proper input filtering in open-ended functions

Over-granted permissions to LLM plugins.

Excessive Agency
P R E V E NT I O N

Excessive Agency in LLM refers to


Limit plugin/tools accessible to LLM

vulnerabilities enabling harmful actions Implement only necessary functions in plugins

Avoid open-ended functions, prefer granular functionality

due to unexpected LLM outputs, caused Limit LLM plugins' permissions on other systems

Use OAuth for user authentication, granting minimum necessary


by excessive functionality, permissions, or
privileges

autonomy. Require human approval for all actions.

AT TAC K S C E N A R I O S

A personal assistant app with access to a user's mailbox is tricked into

sending spam emails. Prevention: use a read-only plugin, authenticate with

read-only scope, require user to manually send emails, or implement rate

limiting on sending interface.


| OWASP Top 10 for LLM

EXAMPLES
LLM09

Misinformation from incorrect LLM outputs

Logically incoherent LLM outputs

Confusion due to LLM merging varied sources

Overreliance LLM-suggested insecure code

Inadequate LLM risk communication.

Overreliance on LLMs refers to the


P R E V E NT I O N

vulnerability that arises when systems or


Monitor LLM outputs, filter inconsistencies, and enhance with fine-tuning

individuals excessively trust LLMs for Verify LLM outputs with trusted sources

Implement automatic validation mechanisms


decision-making or content creation
Break tasks into subtasks

without appropriate oversight, leading to Communicate LLM-related risks clearly

Develop safe interfaces and APIs

potential misinformation, Establish secure coding practices.

miscommunication, or security risks.


AT TAC K S C E N A R I O S

False news spread due to AI misinformation

Security vulnerabilities from AI coding suggestions

Malicious package integration due to false LLM suggestion.


| OWASP Top 10 for LLM

EXAMPLES
LLM10

External unauthorized access to LLM repositories

Leaking models by insiders

Network/application security misconfigurations

Model Theft Shared GPU services exploited for model access

Replication of models via querying or prompt injection

Side-channel attacks retrieving model data.


LLM Model Theft refers to unauthorized

access and extraction of Language Model P R E V E NT I O N

models, leading to economic loss, Strong access controls/authentication for LLM repositories

Limiting LLM's access to network resources


competitive disadvantage, unauthorized
Regular monitoring/auditing of LLM-related activities

model usage, and potential exposure of Automated MLOps deployment with governance

Rate limiting and exfiltration detection techniques.

sensitive information.

AT TAC K S C E N A R I O S

Infrastructure vulnerability exploits

Exploitation of shared GPU services

Shadow model creation via API querying

Insider-conducted side-channel attacks and employee leaks.


| OWASP Top 10 for LLM

Key Reference Links


Arxiv: Prompt Injection attack against LLM-integrated Application MITRE: Tay Poisonin
Defending ChatGPT against Jailbreak Attack via Self-Reminde Backdoor Attacks on Language Models: Can We Trust Our Model’s
GitHub: OpenAI Chat Markup Languag Weights
Arxiv: Not what you’ve signed up for: Compromising Real-World Arxiv: Poisoning Language Models During Instruction Tunin
LLM-Integrated Applications with Indirect Prompt Injectio ChatGPT Data Breach Confirmed as Security Firm Warns of
AI Village: Threat Modeling LLM Application Vulnerable Component Exploitatio
OpenAI: Safety Best Practice What Happens When an AI Company Falls Victim to a Software
Snyk: Arbitrary Code Executio Supply Chain Vulnerabilit
Stanford: Training Dat OpenAI: Plugin Review Proces
CSO: How data poisoning attacks corrupt machine learning model Compromised PyTorch-nightly dependency chain
MITRE: ML Supply Chain Compromise

You might also like