Skip to main content

Bleeding Llama, CVE-2026-7482: An Unauthenticated Heap Leak in Ollama

· 10 min read
Ankush K
Co-founder and CTO, Dwaar
Bleeding Llama, CVE-2026-7482: An Unauthenticated Heap Leak in Ollama

Someone in your company has probably set up Ollama on a shared machine so more than one service can call the same model. If that machine is not on an asset list, nobody got a ticket this week, and this is a bug you want a ticket for: three HTTP calls with no credentials can send a piece of the server's heap to a registry the attacker controls.

ItemDetail
IdentifierCVE-2026-7482, dubbed Bleeding Llama
AffectedOllama before 0.17.1
Fixed in0.17.1
SeverityCVSS 3.1 9.1 Critical and CVSS 4.0 8.8 High, both scored by the CNA, Echo
Exploited as of 2026-05-07No confirmed exploitation. CISA's SSVC entry of May 4 records exploitation as none, and the CVE is not listed in KEV. Some trackers carry exploitation labels (Feedly) without naming an attempt, a victim or any telemetry. A public PoC repository appeared on May 5.
DisclosedCVE record on 2026-05-04, press coverage of the finders' research on 2026-05-05

The CVE record credits the researchers Dor Attias and Ofek Itach as finders. SecurityWeek reported their research on May 5, a day after the record was published.

A header that nobody checked​

A GGUF file declares an offset and a size for each of its tensors. Ollama believed those numbers in two places.

Decode() in fs/ggml/gguf.go took the declared values and never compared them with the size of the file. Then quantizer.WriteTo() in server/quantization.go read each tensor through a section sized by the declared value and turned the bytes into floats. The v0.17.0 code branches on the source type:

if fsggml.TensorType(q.from.Kind) == fsggml.TensorTypeF32 {
f32s = unsafe.Slice((*float32)(unsafe.Pointer(&data[0])), q.from.Elements())
} else {
f32s = ggml.ConvertToF32(data, q.from.Kind, q.from.Elements())
}

Both branches take their length from the element count the header declared, not from the bytes that came back. When the file is shorter than the header claims, the code walks past data into adjacent heap memory, and the quantized output goes into the new model blob. The CVE text states the outcome: "the server reads past the allocated heap buffer".

The finders count three unauthenticated API calls. The CVE text names /api/create and /api/push, and Ollama's API documentation supplies the first step, because a GGUF has to be pushed as a blob before /api/create can use it:

  1. POST /api/blobs/sha256:... uploads a GGUF whose tensors claim more data than the file holds.
  2. POST /api/create with a quantize target runs the quantizer and bakes the adjacent heap bytes into a new model.
  3. POST /api/push sends that model to a registry the attacker controls.

The CVE text says /api/create and /api/push "have no authentication in the upstream distribution", so a network path is all the attacker needs. It lists what the heap can give up: environment variables, API keys, system prompts and other users' conversations. SecurityWeek's report gives a similar list from the finders: prompts, messages and environment variables. A shared inference server is a bad place to leak from, because every caller's prompts pass through that process.

The fix commit closes both gaps. Decode now fails with tensor %q offset+size (%d) exceeds file size (%d), and the quantizer fails with tensor %s data size %d is less than expected %d from shape %v when it reads fewer bytes than the shape implies.

The patch came ten weeks before the warning​

PR #14406, "ggml: ensure tensor size is valid", merged on 2026-02-25 and never mentions security. The v0.17.1 release notes list no security fix either. The CVE record arrived about ten weeks later, so a team that upgrades when release notes say "security" had no reason to move until this week. The record's datePublic field says 2026-02-25, which is the patch date, not the day the CVE appeared.

The record shows how late the identifier came: reserved on 2026-04-30, about nine weeks after the fix merged, and published on 2026-05-04 with Echo as the assigning CNA. My position is that a fix for an unauthenticated memory leak should say so in its release notes, because a quiet patch leaves the people running old versions with nothing to act on.

Do not work out your exposure from install dates. GitHub displays the v0.17.1 release as 24 February, before the fix merged at 01:52 UTC on 25 February, yet the tag points at a commit dated 25 February that contains the fix. Compare version numbers.

What to do now​

  1. Find every instance. Search hosts, images and cloud accounts for Ollama, and for anything listening on TCP 11434. Look for OLLAMA_HOST=0.0.0.0 in whatever configures the service, including container images.
  2. Upgrade to 0.17.1 or later. Anything below 0.17.1 is affected.
  3. If you cannot upgrade today, apply the workarounds in the CVE record. Bind Ollama to a trusted interface only (the record gives the default as 127.0.0.1), put a reverse proxy that requires authentication in front of /api/create and /api/push, and restrict outbound traffic from the host so a push cannot reach an attacker's registry.
  4. Block port 11434 from outside and segment these servers. 11434 is the default port in envconfig/config.go. SecurityWeek's report advises restricting network access and segmenting deployments, and I would do both even after patching.
  5. Rotate secrets on any old version that was reachable from the internet. The same report says to consider any instance accessible from the internet, along with its environment variables and the data passing through it, to be compromised, and I read that as a reason to rotate. I found no published technical indicators, so do not wait for proof of compromise.
  6. Audit the agents and applications routed through each server. Their system prompts and conversations are the data at stake.
  7. Read your reverse-proxy and access logs. Look for one client uploading a blob, then a create with a quantize setting, then a push to an unfamiliar registry host. This pattern is my inference from the documented chain, not a published indicator. A hit deserves an incident. A miss does not clear the server.

The score does not tell you much here​

An unpatched instance on loopback and one on a public address carry the same CVSS number, which is why CVSS is not risk. The more useful line in the record is the CISA-ADP SSVC entry: exploitation none, automatable yes, technical impact total. "None" describes May 4. "Automatable" does not expire.

Inference servers need an owner​

The sources disagree on the default. The CVE text says "Default deployments bind to 127.0.0.1", and envconfig/config.go at v0.17.0 agrees. SecurityWeek's report, citing the finders, says Ollama "listens to all network interfaces". The code settles it for the binary, but the Dockerfile at v0.17.0 sets ENV OLLAMA_HOST=0.0.0.0:11434, so a container built from it listens on every interface it has.

Even where the default holds, loopback stops working the moment a second machine needs the model, and the CVE text calls the documented OLLAMA_HOST=0.0.0.0 configuration "widely used in practice". With no authentication upstream, that one setting is the whole access control decision.

The finders estimate "approximately 300,000 Ollama servers currently exposed on the public internet". SecurityWeek's report, which carries that figure, does not explain the measurement, and I would not read it as a count of unpatched servers. Your own count is the one that matters.

A self-hosted inference server deserves the treatment you give a database: off public addresses, authentication in front, outbound traffic limited, and written down. A version check only helps once the box is in scope, which is why you cannot secure what you cannot list. That gap is what Dwaar addresses: discovering what you ship from source control, registries and cloud accounts, scanning it, and keeping one findings list with EPSS and KEV signals.

Take one cloud account today and find everything in it listening on 11434. For each hit, write down the version, the bind address, who can reach it and which secrets sit in its environment. If that list surprises you, repeat it for the next account.

References​