CVE-2024-45436: Ollama can extract members of a ZIP archive outside of the parent directory
Ollama before 0.1.47 can extract members of a ZIP archive outside the intended directory. The extractFromZipFile function in the server does not check where each entry lands, so a crafted archive can write files elsewhere on the host. Upgrade to Ollama 0.1.47.
Published Aug 29, 2024 · Analysis Nov 1, 2026
What an attacker can do
When Ollama imports a model from a ZIP archive, extractFromZipFile in server/model.go joined each archive entry name onto the target directory without checking the result. An entry name containing ../ therefore writes outside that directory (CWE-22, the classic zip slip). The write runs with the privileges of the Ollama process.
The CVSS vector rates it network-reachable with no privileges and no user interaction, because the Ollama API has no authentication by default. The impact it assigns is integrity only. An attacker who can get a crafted archive processed by the server can create or overwrite files the Ollama user can write, such as shell profiles, SSH authorized_keys, or service files, and that can be turned into code execution depending on the host. Containerized deployments limit the reach to the container.
An Ollama server exposed on a network beyond localhost, which is common for shared or agent-backed model hosts, is the exposed case. The advisory text itself is short and states no exploit chain beyond the extraction flaw.
Who is affected
The Go module github.com/ollama/ollama, versions below 0.1.47. Check the running version:
ollama --versionFor a module dependency:
go list -m github.com/ollama/ollamagithub.com/ollama/ollama
- Ecosystem
- Go
- Affected
- < 0.1.47
- Fixed in
- 0.1.47
- Check
go list -m github.com/ollama/ollama
How to fix it
Upgrade to Ollama 0.1.47 or later. The fix, commit 123a722a6f541e300bc8e34297ac378ebe23f527 in pull request 5314, builds each destination with filepath.Join(p, f.Name). When the result does not start with the target directory, it skips the entry and logs "skipped extracting file outside of context". The sources name no workaround. Keep the Ollama API bound to localhost or behind authentication.
How to tell if you were hit
Check Ollama logs for the message "skipped extracting file outside of context", which shows patched versions blocking an attempt. On older versions, look for files created or changed outside Ollama's model directories around the time of a model create or import request, such as new entries in authorized_keys, shell startup files or cron directories. Review API access logs for model create requests from unknown clients.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
extractFromZipFile in model.go in Ollama before 0.1.47 can extract members of a ZIP archive outside of the parent directory.
Questions
- Is Ollama 0.1.46 affected by CVE-2024-45436?
Yes. Every version below 0.1.47 is listed as vulnerable, and 0.1.47 contains the fix.
- Does it need authentication?
The CVSS vector sets no privileges. Ollama's API has no built-in authentication, so reachability of the server decides who can try it.
- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog.
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 entriesCVE-2026-7482
Ollama contains a heap out-of-bounds read vulnerability in the GGUF model loader
high9.1May 4, 2026CVE-2026-7020
Ollama is Vulnerable to Path Traversal
low5.6No fixApr 26, 2026CVE-2025-63389
Ollama Platform has missing authentication enabling attackers to perform model management operations
critical9.3No fixDec 18, 2025CVE-2025-44779
Ollama allows deletion of arbitrary files
medium6.6Aug 7, 2025CVE-2025-51471
Ollama vulnerable to Cross-Domain Token Exposure
medium6.9No fixJul 22, 2025CVE-2025-1975
Ollama Server Vulnerable to Denial of Service (DoS) Attack
high7.5No fixMay 16, 2025
