Ollama Arbitrary File Deletion Vulnerability

Vulnerability

A vulnerability allowing arbitrary file deletion has been identified in Ollama versions through 0.1.33. The issue arises when a file already exists at the path where a 'digest' is to be saved. In such cases, Ollama mistakenly interprets the file as having a mismatched 'digest' value, leading to its deletion. This flaw can be exploited by sending a crafted request to the '/api/pull' endpoint, either through the Ollama command line interface or via direct API calls.

Impact

Exploitation of this vulnerability results in the unintended deletion of files on the server where Ollama is running.

Reproduction

To reproduce this vulnerability, first upload a file to the Ollama server. Then, send a request to the '/api/pull' endpoint, specifying a 'digest' that points to the uploaded file. Ollama will attempt to save the 'digest', but upon detecting the existing file, it will delete it instead.

Remediation

Users are advised to upgrade Ollama to version 0.1.34 or later.

Added: Aug 7, 2025, 4:30 PM
Updated: Aug 7, 2025, 4:30 PM

Vulnerability Rating

Custom Algorithm
spread
2.6
impact
2.5
exploitability
7.2
remediation
7.7
relevance
0.3
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.