CVE-2024-12886 Out-Of-Memory (OOM) Vulnerability in ollama/ollama
A malicious API server can crash the Ollama server by sending a gzip bomb, causing a denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-12886?
CVE-2024-12886 is a high-severity denial of service vulnerability in ollama/ollama, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
An Out-Of-Memory (OOM) vulnerability exists in the `ollama` server version 0.3.14. This vulnerability can be triggered when a malicious API server responds with a gzip bomb HTTP response, leading to the `ollama` server crashing. The vulnerability is present in the `makeRequestWithRetry` and `getAuthorizationToken` functions, which use `io.ReadAll` to read the response body. This can result in excessive memory usage and a Denial of Service (DoS) condition.
Weakness: CWE-409
Which versions are affected by CVE-2024-12886?
3 open source packages ship an affected version, including github.com/ollama/ollama.
| Package | Affected | Fixed in |
|---|---|---|
github.com/ollama/ollama Go | All versions to 0.3.14 | None |
github.com/ollama/ollama Go | All versions to 0.3.14 | None |
github.com/ollama/ollama Go | All versions | 0.4.0-ci1 |
How do I fix CVE-2024-12886?
Upgrade github.com/ollama/ollama to 0.4.0-ci1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2024-12886 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-12886 exists.
Public exploit code: 2 proofs of concept on GitHub.
Sources
Also known as GHSA-v464-r2r9-www7, GO-2025-3548.