CVE-2026-102697: Ollama: agent Bash approval bypass via shell operators

HIGH
Published September 29, 2026
CISO Take

Ollama's experimental agent mode checks Bash commands against an approved prefix without actually parsing shell syntax. A prompt-injected model can append operators such as semicolons or && to an approved command and run arbitrary extra commands without a new approval prompt. Exploitation is not currently observed: it is not in CISA KEV, there is no public exploit or Nuclei template, and SSVC says TRACK. However, EPSS sits in the top 97th percentile, and the package has 1,776 dependents and 36 other CVEs, so the exposure is real for developer workstations that use agent mode. Upgrade to Ollama 0.31.2 or later, and until then do not use experimental agent mode with untrusted content or approve only commands you have read in full.

Sources:NVDEPSSATLASGitHub AdvisoryVulnCheckgithub.com/ollama/ollama

What is the risk?

High (CVSS 7.8), but narrowed by preconditions: the attack is local, needs user interaction (the user must approve a session command and start the agent flow), and requires the attacker to influence model output through prompt injection. The EPSS score is low in absolute terms (0.00146) but ranks in the top 97th percentile. There is no KEV listing, no public exploit and no scanner template, and SSVC says TRACK. The impact is full compromise of confidentiality, integrity and availability within the user's privileges, including access to source code, SSH keys, cloud credentials and API tokens on developer machines. The affected feature is experimental, which limits the number of exposed deployments. The wide ecosystem (1,776 dependents) and the package's 84/100 risk score and 36 other CVEs raise the priority.

How does the attack unfold?

Initial Access
Attacker plants malicious instructions in content the Ollama agent will read, such as a web page, document or repository.
AML.T0051.001
Tool Invocation
The injected prompt makes the model propose an already-approved command with control operators appended.
AML.T0053
Approval Bypass and Execution
The prefix-based approval check accepts the chained string, so the shell runs the extra commands without a new prompt.
AML.T0050
Impact
The attacker steals credentials and data or establishes persistence with the user's privileges on the host.
AML.T0112.000

What systems are affected?

PackageEcosystemVulnerable RangePatched
Ollamapip—No patch
187.0K1.9K dependentsPushed 4d ago19% patched~36d to patchFull package profile →

Do you use Ollama? You're affected.

How severe is it?

CVSS 3.1
7.8 / 10
EPSS
0.1%
chance of exploitation in 30 days
Higher than 4% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Moderate

What is the attack surface?

AVACPRUISCIA
AVLocal
ACLow
PRNone
UIRequired
SUnchanged
CHigh
IHigh
AHigh

What should I do?

1 step
  1. 1) Upgrade Ollama to 0.31.2 or later (fix commit a2b3a5e9a3956bc0700a8505580c11faf4da09b5). 2) Until patched, disable experimental agent mode or the Bash tool, and never grant session-wide approval for shell commands. 3) Run agent mode in a sandbox, container or low-privilege VM with no access to credentials, SSH keys or cloud tokens. 4) Avoid feeding untrusted content (web pages, documents, repositories) to agent sessions. 5) Inventory Ollama versions across developer endpoints and flag 0.14.0 to 0.31.1. 6) Detection: alert on shell child processes spawned by the Ollama process that include chained operators (;, &&, ||, |, backticks, $()), unexpected outbound network connections from those shells, and access to credential files. 7) Review the vendor release notes and the VulnCheck advisory for further details.

What does CISA's SSVC say?

DecisionTrack
Exploitationnone
AutomatableNo
Technical Impacttotal

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Art. 15-Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6-AI system operation and monitoring
NIST AI RMF
MANAGE 2.3-Responses to previously unknown risks are managed
OWASP LLM Top 10
LLM01-Prompt InjectionLLM06-Excessive Agency

Frequently Asked Questions

What is CVE-2026-102697?

Ollama's experimental agent mode checks Bash commands against an approved prefix without actually parsing shell syntax. A prompt-injected model can append operators such as semicolons or && to an approved command and run arbitrary extra commands without a new approval prompt. Exploitation is not currently observed: it is not in CISA KEV, there is no public exploit or Nuclei template, and SSVC says TRACK. However, EPSS sits in the top 97th percentile, and the package has 1,776 dependents and 36 other CVEs, so the exposure is real for developer workstations that use agent mode. Upgrade to Ollama 0.31.2 or later, and until then do not use experimental agent mode with untrusted content or approve only commands you have read in full.

Is CVE-2026-102697 actively exploited?

No confirmed active exploitation of CVE-2026-102697 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-102697?

1) Upgrade Ollama to 0.31.2 or later (fix commit a2b3a5e9a3956bc0700a8505580c11faf4da09b5). 2) Until patched, disable experimental agent mode or the Bash tool, and never grant session-wide approval for shell commands. 3) Run agent mode in a sandbox, container or low-privilege VM with no access to credentials, SSH keys or cloud tokens. 4) Avoid feeding untrusted content (web pages, documents, repositories) to agent sessions. 5) Inventory Ollama versions across developer endpoints and flag 0.14.0 to 0.31.1. 6) Detection: alert on shell child processes spawned by the Ollama process that include chained operators (;, &&, ||, |, backticks, $()), unexpected outbound network connections from those shells, and access to credential files. 7) Review the vendor release notes and the VulnCheck advisory for further details.

What systems are affected by CVE-2026-102697?

This vulnerability affects the following AI/ML architecture patterns: Agent frameworks, Local LLM inference, Developer workstations with AI coding agents, Tool-calling LLM pipelines.

What is the CVSS score for CVE-2026-102697?

CVE-2026-102697 has a CVSS v3.1 base score of 7.8 (HIGH). The EPSS exploitation probability is 0.15%.

What is the AI security impact?

Affected AI Architectures

Agent frameworksLocal LLM inferenceDeveloper workstations with AI coding agentsTool-calling LLM pipelines

MITRE ATLAS Techniques

AML.T0050Command and Scripting Interpreter
AML.T0051.001Indirect
AML.T0053AI Agent Tool Invocation
AML.T0112.000Local AI Agent

Compliance Controls Affected

EU AI Act: Art. 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE 2.3
OWASP LLM Top 10: LLM01, LLM06

What are the technical details?

Original Advisory

Ollama versions 0.14.0 before 0.31.2 contain an incorrect authorization vulnerability in the experimental agent mode Bash tool approval mechanism that fails to properly parse shell syntax. Attackers who can influence model output through prompt injection can execute additional shell commands by appending control operators like semicolons or logical operators to approved commands, bypassing the session approval requirement.

Exploitation Scenario

A developer runs a local model in Ollama's experimental agent mode and asks it to summarize a third-party repository or web page. The content contains a hidden indirect prompt injection that tells the model to run a harmless command the user has already approved for the session, such as an ls or git status, followed by a semicolon and a command that reads ~/.ssh and ~/.aws and posts them to an attacker server. Because the approval check only compares the command prefix, the whole chained string is treated as approved and executes without a new prompt. The attacker obtains credentials and can pivot into source repositories and cloud accounts.

Weaknesses (CWE)

CWE-863 — Incorrect Authorization: The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.

  • [Architecture and Design] Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • [Architecture and Design] Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Timeline

Published
September 29, 2026
Last Modified
September 29, 2026
First Seen
September 29, 2026

Related Vulnerabilities