CVE-2025-0312
📋 TL;DR
A null pointer dereference vulnerability in Ollama versions up to 0.3.14 allows attackers to upload specially crafted GGUF model files that crash the server, causing denial of service. This affects all Ollama servers running vulnerable versions that accept model uploads from untrusted sources.
💻 Affected Systems
- ollama/ollama
📦 What is this software?
Ollama by Ollama
⚠️ Risk & Real-World Impact
Worst Case
Sustained DoS attacks could render Ollama services completely unavailable, disrupting AI/ML workflows and dependent applications.
Likely Case
Intermittent service crashes requiring manual restart of Ollama processes, causing temporary service disruption.
If Mitigated
Minimal impact with proper network segmentation and trusted source controls for model uploads.
🎯 Exploit Status
Exploitation requires creating a malicious GGUF model file with specific null pointer triggers. No authentication needed for model upload endpoints.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: >0.3.14
Vendor Advisory: https://huntr.com/bounties/522c87b6-a7ac-41b2-84f3-62fd58921f21
Restart Required: No
Instructions:
1. Update Ollama to version >0.3.14 using your package manager or download from official sources. 2. Verify the update completed successfully. 3. No service restart required as updates typically apply immediately.
🔧 Temporary Workarounds
Restrict model upload sources
allOnly allow model uploads from trusted, verified sources and implement upload validation
Network segmentation
allPlace Ollama servers behind firewalls with restricted access to model upload endpoints
🧯 If You Can't Patch
- Implement strict network access controls to limit who can upload models to Ollama servers
- Deploy monitoring and alerting for repeated server crashes or abnormal model upload patterns
🔍 How to Verify
Check if Vulnerable:
Check Ollama version with 'ollama --version' or examine installed package version
Check Version:
ollama --version
Verify Fix Applied:
Confirm version is >0.3.14 and test model upload functionality with known safe models
📡 Detection & Monitoring
Log Indicators:
- Segmentation fault errors in Ollama logs
- Unexpected process termination
- Failed model creation attempts with malformed files
Network Indicators:
- Multiple rapid model upload attempts from single source
- Unusual GGUF file upload patterns
SIEM Query:
source="ollama.log" AND ("segmentation fault" OR "null pointer" OR "panic")