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

High 8.8 Published Updated

Attackers can bypass digest validation to access or modify arbitrary files via path traversal in Ollama model handling.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-37032?

CVE-2024-37032 is a high-severity path traversal vulnerability in n/a, published on 31 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

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.

Weakness: CWE-22

Which versions are affected by CVE-2024-37032?

3 open source packages ship an affected version, including github.com/ollama/ollama. It affects 1 product.

PackageAffectedFixed in
github.com/ollama/ollama GoAll versions0.1.34
github.com/ollama/ollama GoAll versions0.1.34
github.com/ollama/ollama GoAll versions0.1.34

Products include Ollama Ollama.

How do I fix CVE-2024-37032?

Upgrade github.com/ollama/ollama to 0.1.34 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-37032 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-37032 exists.

Public exploit code: 1 Metasploit module, 1 Nuclei template and 4 proofs of concept on GitHub.

Sources

Also known as GHSA-8hqg-whrw-pv92, GO-2024-2901.

Is CVE-2024-37032 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free