Back

HIGH

Ollama heap out-of-bounds read in GGUF tensor parsing leaks server process memory to unauthenticated remote attackers

Published May 4, 2026

Description

Ollama before 0.17.1 contains a heap out-of-bounds read vulnerability in the GGUF model loader. The /api/create endpoint accepts an attacker-supplied GGUF file in which the declared tensor offset and size exceed the file's actual length; during quantization in fs/ggml/gguf.go and server/quantization.go (WriteTo()), the server reads past the allocated heap buffer. The leaked memory contents may include environment variables, API keys, system prompts, and concurrent users' conversation data, and can be exfiltrated by uploading the resulting model artifact through the /api/push endpoint to an attacker-controlled registry. The /api/create and /api/push endpoints have no authentication in the upstream distribution. Default deployments bind to 127.0.0.1, but the documented OLLAMA_HOST=0.0.0.0 configuration is widely used in practice (large public-internet exposure observed).

Affected products

Remediation

Vendor solution

Upgrade to ollama 0.17.1 or later. The fix in PR #14406 validates that declared tensor offset+size do not exceed the GGUF file size before reading, and adds a length check in the quantizer prior to the unsafe read.

Red Hat statement

An Important information disclosure flaw exists in Ollama, allowing a remote, unauthenticated attacker to read heap memory via a crafted GGUF file submitted to the /api/create endpoint. This can expose sensitive data, including API keys and user conversation data, which can then be exfiltrated. While default deployments bind to localhost, configurations exposing Ollama to the public internet significantly increase the risk. In this flaw a network attacker may leak sensitive data (C:H, I:N) with limited scope of system denial of servci (A:L), where a system reboot may not be the scenario.

Metrics

References (8)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner Echo
Published May 4, 2026
Updated May 4, 2026
Reserved Apr 30, 2026
CISA Vulnrichment
Updated May 4, 2026
NVD
Status Analyzed
Modified Jun 17, 2026
Red Hat
Severity Critical
Public date May 4, 2026
GHSA-X8QC-FGGM-MPQG