CVE-2026-103663 PUBLISHED

Path Traversal leading to Remote Code Execution in Ollama

Assigner: CERT-PL
Reserved: 01.10.2026 Published: 08.10.2026 Updated: 08.10.2026

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.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N
CVSS Score: 6.9

Server process does not have write access to /usr/lib/ollama

CVSS 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
CVSS Score: 9.4

Server process has write access to /usr/lib/ollama

Product Status

Vendor Ollama
Product Ollama
Versions Default: unknown
  • affected from 0.34.2 to 0.35.0 (excl.)

Credits

  • Bartłomiej Dmitruk (striga.ai) finder

References

Problem Types

  • CWE-23 Relative Path Traversal CWE
  • CWE-913 Improper Control of Dynamically-Managed Code Resources CWE

Impacts

  • CAPEC-139 Relative Path Traversal