CVE-2024-37032: Github.com/ollama/ollama Ollama Does Not Validate The Vulnerability

MODERATE
Advisory Identifier: GHSA-8hqg-whrw-pv92
Published
Advisory Summary

CVE-2024-37032 is a MODERATE ollama does not validate the vulnerability (General Security Weakness) affecting Github.com/ollama/ollama libraries in the Go ecosystem. The issue involves ollama does not validate the format of the digest (sha256 with 64 hex digits). Remediation is available by upgrading affected packages to version 0.1.34.

CVE-2024-37032 at a Glance

CVE Identifier CVE-2024-37032
GHSA Identifier GHSA-8hqg-whrw-pv92
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/ollama/ollama
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2024-37032

To remediate this vulnerability, upgrade all affected Github.com/ollama/ollama dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/ollama/ollama fixed: 0.1.34
Upgrade github.com/ollama/ollama to 0.1.34
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/ollama/ollama

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-37032, inspect your project dependencies for Github.com/ollama/ollama:

inspect dependencies for github.com/ollama/ollama

Analyze the terminal output to locate any version of Github.com/ollama/ollama in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.34), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Github.com/ollama/ollama, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2024-37032 Affected Github.com/ollama/ollama Versions

1 component(s)
Fixed Versions:
0.1.34
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ollama/ollama
Go
< 0.1.34
0.1.34

References

Frequently Asked Questions

What is CVE-2024-37032?
CVE-2024-37032 is a security vulnerability in Github.com/ollama/ollama involving Ollama does not validate the format of the digest (sha256 with 64 hex digits) under General Security Weakness.
Which Github.com/ollama/ollama versions are affected?
Affected versions include releases prior to 0.1.34 across affected packages: github.com/ollama/ollama.
What version fixes CVE-2024-37032?
Upgrading to 0.1.34 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ollama/ollama affected?
Yes, github.com/ollama/ollama is affected in releases prior to 0.1.34. Upgrade your dependency to 0.1.34 or later.
What CWE is associated with CVE-2024-37032?
CVE-2024-37032 is classified under General Security Weakness.
How can I check Go dependencies for CVE-2024-37032?
Run the dependency tree command: 'inspect dependencies for github.com/ollama/ollama'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8hqg-whrw-pv92",
  "modified" : "2024-09-06T21:37:30Z",
  "published" : "2024-05-31T06:30:27Z",
  "aliases" : [ "CVE-2024-37032" ],
  "summary" : "Ollama does not validate the format of the digest (sha256 with 64 hex digits)",
  "details" : "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.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ollama/ollama"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.34"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37032"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ollama/ollama/pull/4175"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ollama/ollama/commit/2a21363bb756a7341d3d577f098583865bd7603f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-8hqg-whrw-pv92"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ollama/ollama"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ollama/ollama/blob/adeb40eaf29039b8964425f69a9315f9f1694ba8/server/modelpath_test.go#L41-L58"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ollama/ollama/compare/v0.1.33...v0.1.34"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2901"
  }, {
    "type" : "WEB",
    "url" : "https://www.vicarius.io/vsociety/posts/probllama-in-ollama-a-tale-of-a-yet-another-rce-vulnerability-cve-2024-37032"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-02T22:32:29Z",
    "nvd_published_at" : "2024-05-31T04:15:09Z"
  }
}