Ollama CVE-2026-103663: How a Poorly Validated Digest in /api/pull Ends Up as Root Inside Docker

By Carlos Montiel | Enterprise AI Specialist
Leer en español →
Published: 2026-10-16 | By: Carlos Montiel | Reading time: ~5 minutes

Ollama is the most common way to run local models, and its Docker image often allows writing to the directory it loads components from. CERT Polska published a vulnerability on October 8 that combines both: with no authentication, an attacker can plant a file and get root execution on the next restart.

What CVE-2026-103663 Is

It is a relative path traversal vulnerability (CWE-23) in the /api/pull endpoint of Ollama, the one that downloads models from a registry. According to the CERT Polska advisory, the digestToPath function does not properly validate the digest of each model layer. An unauthenticated remote attacker can send a directory traversal sequence as the digest and get a malicious binary written outside the model store. The report credits Bartłomiej Dmitruk (striga.ai).

CVE-2026-103663 · Ollama /api/pull Type ............... Path traversal (CWE-23) Authentication ..... none Published .......... October 8, 2026 (CERT Polska) Fix ................ Ollama 0.35.0 Affected range ..... 0.34.2 to 0.35.0 per advisories (ambiguous boundary: upgrade to 0.35.0 or later) CVSS ............... 9.4 (critical) per some sources; 6.9 (medium, CVSS v4) per others

How It Works: From Writing a File to Being Root

An arbitrary write on its own is not code execution. The jump comes from a deployment condition: if the server process can write to /usr/lib/ollama (which, according to CERT Polska, is the default in most Ollama Docker images), the attacker drops their file there. On the next server restart, that file is loaded and executed with root privileges. In other words, the attack has two phases: plant the file now, execute it when someone (or an orchestrator) restarts the container.

Who Is Actually Exposed

The requirement is that the API be reachable from an untrusted network. Ollama listens on port 11434 by default; if it is bound only to 127.0.0.1, exposure is much lower. The real risk is in installations where someone opened the service to 0.0.0.0 or published the Docker port without restricting it, for example on a cloud GPU VM to "try out a model". These installations usually have no authentication, because Ollama doesn't include it out of the box.

Watch the severity comparison: the gap between 9.4 and 6.9 comes from which CVSS version is used and how much weight is given to the fact that exploitation requires a restart. For an internet-exposed server running the default image, treat it as critical.

Mitigation, in Priority Order

1. Upgrade to Ollama 0.35.0 or later 2. Publish the port on loopback only: docker run -p 127.0.0.1:11434:11434 ... 3. Put an authenticating proxy in front if remote access is needed 4. If it was exposed: inspect /usr/lib/ollama and the model store for unauthorized files, recreate the container from a clean image, and rotate any keys stored in environment variables

What It Means for a Company Using or Buying AI

Business impact: "local" models are not secure just because they are local. (1) Inventory where Ollama runs in your organization, including servers spun up by data teams or developers; the ones nobody remembers are the dangerous ones. (2) No inference service should sit on a reachable network without authentication in front of it. (3) Container images with writable system directories turn a file bug into root: require images with read-only filesystems. (4) If you hire vendors who deploy open models for you, ask for evidence of version and network exposure. It's the same class of problem we saw with LMCache: inference infrastructure is attack surface.
Carlos Montiel
Enterprise AI Solutions Architect
Specialist in LLMs, Agents, and Orchestration
guatemalia.com/#contacto · info@guatemalia.com

Need to implement AI in your company?

Carlos Montiel is an enterprise AI solutions architect. He implements LLMs, Agents, RAG, and orchestrators for companies across Guatemala and Latin America. Reach out for a consultation.

Contact Carlos Montiel

info@guatemalia.com