Description
Ollama is vulnerable to path traversal in the `/api/pull` endpoint due to insufficient validation of layer digests by the `digestToPath` function. An unauthenticated remote attacker can specify a path traversal sequence as a layer digest, causing a malicious binary to be written outside the model store. 

Critically if the server process has write access to `/usr/lib/ollama` (the default in most Ollama Docker images), an attacker can write the malicious file to that directory. On the next server restart, the file is loaded and executed, resulting in remote code execution as root.


This issue was fixed in version 0.35.0.
Published: 2026-10-08
Score: 9.4 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Apply Patch
AI Analysis

Impact

The vulnerability is an unvalidated path traversal in the /api/pull endpoint that allows an unauthenticated attacker to supply a crafted layer digest containing ‘..’ characters. The digestToPath function expands this to a file path outside the model store, enabling the attacker to write an arbitrary binary to the server’s filesystem. If the Ollama process has write permission to the default installation directory (/usr/lib/ollama), the attacker can drop a malicious file there. Upon restarting the server, the binary is loaded and executed with the rights of the server process, typically root, which grants full system control. The weakness is categorized as CWE‑22 (Path Traversal), CWE‑23 (Relative Path Traversal), and CWE‑913 (Insecure Execution of Malicious Code).

Affected Systems

Any Ollama instance running a version earlier than 0.35.0, especially Docker images where the server process has write access to /usr/lib/ollama, is affected.

Risk and Exploitability

The CVSS score of 9.4 classifies this flaw as critical, and the EPSS score of 0.00714 (below 1%) indicates a very low but nonzero exploitation probability. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector is an unauthenticated remote attacker issuing an HTTP request to the /api/pull endpoint from the network. If the attacker can write to the model directory, the malicious binary will be executed when the service restarts, granting root-level control. The combination of high severity, broad potential exploitation preconditions, and remote access makes this a high-priority risk.

Generated by OpenCVE AI on October 10, 2026 at 01:54 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Ollama version 0.35.0 or later, which contains the path traversal fix.
  • If an immediate upgrade is not possible, restrict the Ollama process’s write permissions on /usr/lib/ollama so that it cannot create files outside the intended model store.
  • Implement monitoring of the /usr/lib/ollama directory for unauthorized file creation and trigger alerts or automatic remediation when unexpected binaries appear.

Generated by OpenCVE AI on October 10, 2026 at 01:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 10 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-22
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.2, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

threat_severity

Moderate


Thu, 08 Oct 2026 15:45:00 +0000

Type Values Removed Values Added
First Time appeared Ollama
Ollama ollama
Vendors & Products Ollama
Ollama ollama

Thu, 08 Oct 2026 15:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 08 Oct 2026 13:30:00 +0000

Type Values Removed Values Added
Description Ollama is vulnerable to path traversal in the `/api/pull` endpoint due to insufficient validation of layer digests by the `digestToPath` function. An unauthenticated remote attacker can specify a path traversal sequence as a layer digest, causing a malicious binary to be written outside the model store.  Critically if the server process has write access to `/usr/lib/ollama` (the default in most Ollama Docker images), an attacker can write the malicious file to that directory. On the next server restart, the file is loaded and executed, resulting in remote code execution as root. This issue was fixed in version 0.35.0.
Title Path Traversal leading to Remote Code Execution in Ollama
Weaknesses CWE-23
CWE-913
References
Metrics cvssV4_0

{'score': 9.4, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: CERT-PL

Published:

Updated: 2026-10-08T14:04:14.270Z

Reserved: 2026-10-01T08:54:20.991Z

Link: CVE-2026-103663

cve-icon Vulnrichment

Updated: 2026-10-08T14:04:11.155Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-08T14:16:46.187

Modified: 2026-10-08T20:08:45.857

Link: CVE-2026-103663

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-08T13:19:04Z

Links: CVE-2026-103663 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-10T02:00:11Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-23

    Relative Path Traversal

  • CWE-913

    Improper Control of Dynamically-Managed Code Resources