---
title: "CVE-2026-102697: Ollama - Command Injection"
description: "Ollama 0.14.0 before 0.31.2 contains a command injection caused by improper parsing of shell syntax in the experimental agent mode Bash tool approval mechanism, letting attackers execute additional shell commands by prompt injection, exploit requires attacker to influence model output."
url: https://panop.io/threat-heartbeat/CVE-2026-102697/
---

# CVE-2026-102697 Ollama - Command Injection

Ollama 0.14.0 before 0.31.2 contains a command injection caused by improper parsing of shell syntax in the experimental agent mode Bash tool approval mechanism, letting attackers execute additional shell commands by prompt injection, exploit requires attacker to influence model output.

CVSS base score 7.8 /10

High

CISA KEV

Not listed

Public exploit

None known

Authentication

Not required

EPSS

0.15% chance of exploitation in 30 days

[View the NVD record ↗](https://nvd.nist.gov/vuln/detail/CVE-2026-102697)

## Details

Type

Command Injection

Impact

Remote Code Execution

CVSS vector

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

Published

29 September 2026

Updated

15 October 2026

Weakness

[CWE-863](https://cwe.mitre.org/data/definitions/863.html)

## Vendor fix

Update to version 0.31.2 or later.

Patching closes this CVE. It does not tell you which of your systems run the affected version, or what else is exposed alongside them.

## References

- [https://nvd.nist.gov/vuln/detail/CVE-2026-102697](https://nvd.nist.gov/vuln/detail/CVE-2026-102697)
- [https://www.vulncheck.com/advisories/ollama-0.14.0-before-0.31.2-experimental-agent-bash-approval-bypass-via-prefix-based-authorization](https://www.vulncheck.com/advisories/ollama-0.14.0-before-0.31.2-experimental-agent-bash-approval-bypass-via-prefix-based-authorization)
- [https://github.com/ollama/ollama](https://github.com/ollama/ollama)
- [https://github.com/ollama/ollama/blob/v0.31.1/x/agent/approval.go#L204-L206](https://github.com/ollama/ollama/blob/v0.31.1/x/agent/approval.go#L204-L206)
- [https://github.com/ollama/ollama/blob/v0.31.1/x/agent/approval.go#L389](https://github.com/ollama/ollama/blob/v0.31.1/x/agent/approval.go#L389)
- [https://github.com/ollama/ollama/commit/a2b3a5e9a3956bc0700a8505580c11faf4da09b5](https://github.com/ollama/ollama/commit/a2b3a5e9a3956bc0700a8505580c11faf4da09b5)
- [https://github.com/ollama/ollama/releases/tag/v0.31.2](https://github.com/ollama/ollama/releases/tag/v0.31.2)

[← All CVEs](https://panop.io/threat-heartbeat/)

## What this record can't tell you

- Whether you run the affected software, and where
- Whether an attacker can actually reach and exploit it
- The misconfigurations that never get a CVE number
- What it would cost the business, ranked into what to fix first

Panop answers these inside your environment, for this CVE and every other finding.

[Book a demo](https://panop.io/demo)
