NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Ollama

CVE-2024-37032: Ollama does not validate the format of the digest (sha256 with 64 hex digits)

mediumGHSA-8hqg-whrw-pv92

Ollama before 0.1.34 does not check that a model digest is a sha256 value of 64 hex digits when it builds the blob path. A digest with a leading `../` or the wrong length escapes the model directory. Reports link it to arbitrary file writes and code execution on exposed servers. Upgrade to 0.1.34.

Published May 31, 2024 · Updated Sep 6, 2024 · Analysis Nov 2, 2026

What an attacker can do

When Ollama resolves a blob path from a digest, it did not enforce the format of 64 hex digits. The advisory names the cases its test (TestGetBlobsPath) now covers: fewer than 64 digits, more than 64 digits, and a digest starting with ../. A traversal string lets a request point the path outside the blob store.

Vicarius, which named the issue "Probllama", describes it as a path traversal in Ollama's API server that can lead to arbitrary file writes, and ties it to remote code execution and file reads with a CVSS of 8.8. Its short page does not explain the exact endpoint or the chain to code execution, so I do not repeat a specific exploit.

The attacker needs network access to the Ollama API. Ollama listens on localhost by default, so exposed instances (a changed bind address, a container with a published port) are the risk. With no authentication on the API, an outside caller can be enough. Code execution gives the attacker the host, its models and any credentials.

Who is affected

Go module github.com/ollama/ollama older than 0.1.34. The risk is highest when the API is reachable from other machines.

ollama --version
go list -m github.com/ollama/ollama

github.com/ollama/ollama

Ecosystem
Go
Affected
< 0.1.34
Fixed in
0.1.34
Check
go list -m github.com/ollama/ollama

How to fix it

Upgrade Ollama to 0.1.34 or later. The fix is in pull request 4175 and commit 2a21363. Go vulnerability database entry GO-2024-2901 tracks it.

The sources give no workaround. Until you update, keep the API off public interfaces, and put a reverse proxy with authentication in front of any shared Ollama server.

How to tell if you were hit

Check API logs and proxy logs for model pull, push or blob requests with a digest that contains ../, is not 64 hex characters, or contains path separators. Look for files created outside the Ollama models directory. Compare the Ollama process's recent file writes and child processes against what you expect.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Ollama before 0.1.34 does not validate the format of the digest (sha256 with 64 hex digits) when getting the model path, and thus mishandles the TestGetBlobsPath test cases such as fewer than 64 hex digits, more than 64 hex digits, or an initial ../ substring.

Credited to lukas-braune.

Questions

Is Ollama on localhost affected?

The flaw sits in the API server's path handling. A default install bound to localhost is reachable only from the same machine. Servers bound to other addresses carry the main risk.

Which version fixes CVE-2024-37032?

Ollama 0.1.34. Anything older is listed as vulnerable.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Ollama vulnerabilities

All Ollama entries