Browse / Unsafe Model Loading and Supply Chain / CVE-2024-39720
Ollama Out-of-bounds Read
- Class
- Unsafe Model Loading and Supply Chain (filed by a model that read the advisory)
- Technique
- Memory corruption
- Affected
- github.com/ollama/ollama (Go)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
- EPSS
- 2.4% chance of exploitation in 30 days
How it works, in short
A truncated GGUF file uploaded in two requests and referenced by a Modelfile makes the server read out of bounds and crash. (Our summary, written by a model. The source text is below.)
Details
An issue was discovered in Ollama before 0.1.46. An attacker can use two HTTP requests to upload a malformed GGUF file containing just 4 bytes starting with the GGUF custom magic header. By leveraging a custom Modelfile that includes a FROM statement pointing to the attacker-controlled blob file, the attacker can crash the application through the CreateModel route, leading to a segmentation fault (signal SIGSEGV: segmentation violation).
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-39720
- https://github.com/ollama/ollama
- https://github.com/ollama/ollama/compare/v0.1.45...v0.1.46#diff-782c2737eecfa83b7cb46a77c8bdaf40023e7067baccd4f806ac5517b4563131L417
- https://oligo.security/blog/more-models-more-probllms
- https://oligosecurity.webflow.io/blog/more-models-more-probllms
- https://pkg.go.dev/vuln/GO-2024-3245
Source: GitHub Advisory Database, used under CC BY 4.0.