NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Ollama

CVE-2025-0317: Ollama Divide By Zero vulnerability

highCVSS 3.0 7.5GHSA-9gcr-28rp-cc24

A crafted GGUF model file makes the `ggufPadding` function in Ollama 0.3.14 and earlier divide by zero, which crashes the server. An attacker uploads the file and creates the model to trigger it. The advisory data lists no patched version.

Published Mar 20, 2025 · Updated Mar 22, 2025 · Analysis Nov 1, 2026

What an attacker can do

When Ollama creates a model from an uploaded GGUF file, ggufPadding computes padding for tensor data. A file with values that make the divisor zero causes a division by zero. The Go runtime panics and the server process exits. The weakness is CWE-369. The CVSS vector requires no privileges and no user interaction, and it affects availability only.

Ollama has no login of its own. Anyone who can reach its API can upload a blob and request creation, so a single small file can stop every client of that server: IDE assistants, agents, chat front ends. Restarting brings it back, but the attacker can repeat the request. The sources describe no data exposure or code execution. The EPSS percentile for this one is unusually high compared with other Ollama entries from the same batch, though no source reports real exploitation.

Who is affected

The Go module github.com/ollama/ollama at 0.3.14 and earlier. The risk is for servers whose API is reachable by people you do not trust.

Check the version:

ollama --version

Also check which interface the server binds to through OLLAMA_HOST.

github.com/ollama/ollama

Ecosystem
Go
Affected
<= 0.3.14
Fixed in
No patched version yet
Check
go list -m github.com/ollama/ollama

How to fix it

The advisory data lists no patched version and no fix commit. Use the latest Ollama release and read its notes on GGUF parsing.

To reduce exposure now, keep the API on localhost or a private network, put an authenticating reverse proxy in front, and run Ollama under a supervisor that restarts it on exit.

How to tell if you were hit

Look for a Go panic with integer divide by zero and a stack trace through ggufPadding in the Ollama log, right after a model create request. Repeated service restarts, and create or blob upload requests from unfamiliar addresses, point to the same thing.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A vulnerability in ollama/ollama versions <=0.3.14 allows a malicious user to upload and create a customized GGUF model file on the Ollama server. This can lead to a division by zero error in the ggufPadding function, causing the server to crash and resulting in a Denial of Service (DoS) attack.

Questions

Which function does CVE-2025-0317 affect?

The advisory names ggufPadding, where a division by zero occurs while Ollama processes a custom GGUF file during model creation.

Is CVE-2025-0317 exploited in the wild?

No source says so, and it is not in CISA's KEV catalog. EPSS is higher than for related Ollama bugs, so patch or isolate the server.

Is there a fixed version?

The advisory lists none and marks 0.3.14 and earlier as vulnerable. Run the newest release and restrict network access.

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 entries