CVE-2025-0312 in ollama
Summary
by MITRE • 03/20/2025
A vulnerability in ollama/ollama versions <=0.3.14 allows a malicious user to create a customized GGUF model file that, when uploaded and created on the Ollama server, can cause a crash due to an unchecked null pointer dereference. This can lead to a Denial of Service (DoS) attack via remote network.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 03/20/2025
The vulnerability identified as CVE-2025-0312 represents a critical security flaw within the ollama/ollama software ecosystem affecting versions 0.3.14 and earlier. This issue manifests through a specific code execution pattern that exploits a fundamental programming error in the handling of GGUF model files, which are commonly used for machine learning model distribution. The vulnerability resides in the server-side processing logic where the application fails to properly validate input parameters during the model creation process, creating an exploitable condition that can be leveraged by remote attackers.
The technical root cause of this vulnerability stems from an unchecked null pointer dereference within the model parsing and validation routines. When a maliciously crafted GGUF file is uploaded and processed by the Ollama server, the application attempts to access memory locations that have not been properly initialized or validated, resulting in an immediate system crash. This behavior directly maps to CWE-476, which specifically addresses null pointer dereference conditions in software applications. The flaw occurs during the model creation phase where the server expects certain metadata fields to be present but does not implement proper null checks before attempting to access these values.
From an operational perspective, this vulnerability creates a significant risk for organizations relying on Ollama servers for machine learning model hosting and processing. The remote exploit capability means that attackers can initiate DoS attacks from any network location without requiring local system access or authentication credentials. This makes the vulnerability particularly dangerous in production environments where continuous availability is critical for business operations. The impact extends beyond simple service disruption as the crash can potentially lead to data loss, service degradation, and increased operational overhead for system administrators tasked with recovery operations.
The attack surface for this vulnerability is broad given the widespread adoption of Ollama for AI model deployment across various industries including finance, healthcare, and technology sectors. Security professionals should consider this vulnerability in their risk assessment frameworks and prioritize remediation efforts, particularly for systems that accept user-uploaded content or operate in untrusted network environments. The vulnerability's classification under the ATT&CK framework would fall under the T1499.004 technique for network denial of service, where adversaries leverage software flaws to disrupt service availability. Organizations should implement immediate mitigations including version upgrades to 0.3.15 or later, network segmentation to limit access to affected servers, and enhanced monitoring for suspicious upload activities. Additionally, input validation should be strengthened through the implementation of comprehensive sanitization routines that prevent malformed GGUF files from reaching the vulnerable processing logic. The remediation approach should also include regular security assessments and code reviews to identify similar patterns that could lead to other null pointer dereference vulnerabilities within the application stack.