CVE-2025-15514
HIGHAny organization running Ollama with multi-modal (vision) models and network-accessible API endpoints is exposed to a trivially exploitable denial-of-service — no authentication, no special knowledge, single crafted HTTP request. Patch immediately or enforce network-level access controls restricting /api/chat to trusted sources. If running Ollama in production AI pipelines or agent frameworks, treat this as a service availability incident risk until mitigated.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
| ollama | pip | — | No patch |
Severity & Risk
Recommended Action
- 1. PATCH: Monitor ollama/ollama GitHub for a release > 0.13.5 with this fix; apply immediately when available. 2. NETWORK ISOLATION (immediate): Bind Ollama to localhost (default: 127.0.0.1:11434) — if exposed on 0.0.0.0, restrict via firewall rules or reverse proxy with authentication. 3. API GATEWAY: Place a WAF or reverse proxy in front of /api/chat that validates Content-Type and enforces payload size limits on image data fields. 4. INPUT VALIDATION WORKAROUND: If modifying application code, validate that base64-decoded image data has a valid MIME magic byte signature (PNG: 0x89504E47, JPEG: 0xFFD8FF) before forwarding to Ollama. 5. MONITORING: Alert on Ollama runner process crashes or unexpected restarts (systemd unit restart events, Docker container restarts). Alert on /api/chat requests containing images/base64 data from unexpected source IPs. 6. PROCESS SUPERVISION: Ensure Ollama runs with automatic restart (systemd Restart=on-failure or Docker restart policy) to minimize downtime from exploitation attempts. 7. AUDIT EXPOSURE: Run 'curl http://your-ollama-host:11434/api/tags' from an external network — if it responds, your instance is publicly exposed.
Classification
Compliance Impact
This CVE is relevant to:
Technical Details
NVD Description
Ollama 0.11.5-rc0 through current version 0.13.5 contain a null pointer dereference vulnerability in the multi-modal model image processing functionality. When processing base64-encoded image data via the /api/chat endpoint, the application fails to validate that the decoded data represents valid media before passing it to the mtmd_helper_bitmap_init_from_buf function. This function can return NULL for malformed input, but the code does not check this return value before dereferencing the pointer in subsequent operations. A remote attacker can exploit this by sending specially crafted base64 image data that decodes to invalid media, causing a segmentation fault and crashing the runner process. This results in a denial of service condition where the model becomes unavailable to all users until the service is restarted.
Exploitation Scenario
Attacker scans for exposed Ollama instances on port 11434 using Shodan or masscan. They identify a target running a vision model (discoverable via GET /api/tags which lists loaded models). They craft a POST request to /api/chat with model set to a multimodal model and an 'images' array containing a base64-encoded payload that decodes to invalid binary data (e.g., random bytes or a truncated file). Ollama passes this to mtmd_helper_bitmap_init_from_buf, which returns NULL due to invalid media format. The subsequent pointer dereference triggers a segfault, crashing the runner process. The attacker can repeat this every time the service restarts, maintaining a persistent DoS condition. No credentials, no AI/ML knowledge, no exploit development required — a 10-line Python script suffices. In an enterprise context where developers have enabled Ollama on their workstations for AI-assisted coding with vision capabilities, this could also be triggered by a malicious web page or document that causes the local Ollama API to be queried with crafted image data.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H References
- https//github.com/ollama/ollama Product
- huntr.com/bounties/172df98b-07cd-41ea-a628-366f8cd525c0 Exploit Patch 3rd Party
- ollama.com Product
- vulncheck.com/advisories/ollama-multi-modal-image-processing-null-pointer-dereference 3rd Party