Skip to content
DoS Disclosed report Intermediate CVE-2024-12886

Ollama Vulnerable to Denial of Service (DoS) via Crafted GZIP

The Ollama server reads HTTP response bodies without a size limit, so a malicious API server can return a gzip bomb that exhausts memory and crashes the server. This causes a denial of service.

github.com/ollama/ollama

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-v464-r2r9-www7, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The code reads the entire HTTP response body into memory without any size limit, so a compressed response can expand to an enormous size.

Impact

A malicious API server could cause the Ollama server to crash, resulting in a denial of service.

What the attacker needed

Ollama server version 0.3.14; Ollama connects to a malicious API server

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A gzip bomb is a small compressed file that expands to a huge amount of data when decompressed. Ollama reads the whole response into memory without checking its size, so a malicious server can send such a bomb and make Ollama run out of memory and crash.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from github.com/ollama/ollama

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.