Skip to content
IAM Insights

Briefing · Video · published · Boston Identity

Before Ollama 0.17.1, a crafted model file could leak chat data to an attacker's registry

A crafted GGUF model file could make older Ollama servers read past a buffer and carry chat data out inside a model pushed to an attacker's registry. Ofek Itach showed it in a DEF CON 34 talk, where he and Vladimir Tokarev also described two race bugs in llama.cpp, one exploited in full on Android. They count 30 vulnerabilities and 11 CVEs, and say llama.cpp's maintainers closed their reports without explanation.

DEFCONConference · November 6, 2026 · watch on YouTube

share
46 minutes of video. With Vladimir Tokarev, speaker; Ofek Itach, speaker.
Claims draw on 5 of 5 segments.
1:03–6:35 · Local inference engines as native-code attack surface · 1 claim7:15–18:08 · llama.cpp Android JNI use-after-free, full exploit · 1 claim18:10–30:05 · llama-server sleep-idle-seconds race: remote use-after-free, partial exploit · 1 claim30:18–40:05 · Ollama GGUF shape: out-of-bounds read and heap leak to a registry · 1 claim40:19–45:42 · Audit patterns, disclosure timeline and defenses · 1 claim
0:00not cited1 claim23+45:42
01

What's happening

Finding5
BI-FIND-2026-2656Lead finding

Itach shows a crafted model file could make Ollama servers before 0.17.1 leak chat data into a model pushed to an attacker's registry (CVE-2026-7482).

Itach describes an Ollama flaw in which the tensor shape in a crafted GGUF model file is passed on "without any validation" when the server creates a model, so it reads past its buffer and the converted model carries heap memory with it. In his proof of concept the leaked memory held chat data he had fed the server, such as credit card numbers or a secret key, and the model was then pushed to a registry he controlled. He says they found more than 30k Ollama servers open, "all of them listening without any authentication", whose memory could in theory have leaked the same way, and that Ollama fixed the flaw once told. The NVD record for it, CVE-2026-7482, which we checked, says Ollama before 0.17.1 is affected and that the leak may include environment variables, API keys, system prompts and other users' conversations. It adds that the /api/create and /api/push endpoints have no authentication upstream, and that default deployments bind to 127.0.0.1 while the documented OLLAMA_HOST=0.0.0.0 setting is widely used.

medium confidencebest source: vendor, marketingobserved Nov 2026Evidence30:18
flag a problem with BI-FIND-2026-2656
BI-FIND-2026-2654

Tokarev describes a full exploit of a race in llama.cpp's Android JNI wrapper, a bug he says has been exposed for almost two years.

The speakers say they have a full exploit for a race in llama.cpp's Android JNI wrapper. Two threads use the same llama_context object with no lock, so one can free it while the other is still working on it, and Tokarev says that ends in control of the app's execution. He says the original wrapper code has since been deleted and replaced, that the replacement still has no mutex on its global pointers, that two lines with a lock guard would fix it, that the bug "has been exposed really for almost two years", and that more than 80 projects use llama.cpp on Android. The NVD record CVE-2026-70640 describes the same race and links llama.cpp release b7446 as the patch; it is one of four VulnCheck records for the wrapper, all covering builds b1886 through b7445.

medium confidencebest source: vendor, marketingobserved Nov 2026Evidence07:15
flag a problem with BI-FIND-2026-2654
BI-FIND-2026-2655

Tokarev says their llama-server demonstration reclaimed freed memory remotely but, with no remote ASLR bypass, stopped short of remote code execution.

In llama-server, the sleep-idle-seconds option frees the idle model's vocabulary while HTTP worker threads can still be using it. The speakers show the freed memory can be reclaimed remotely, but say "we didn't fully exploit it in turn remote code execution" because they had no remote ASLR bypass, and Tokarev says exploitation is harder on macOS, if possible at all. VulnCheck's NVD records for the bug, CVE-2026-43631 and CVE-2026-43632, go further and describe arbitrary or potential code execution; they list affected builds through b9060, then the latest, with no fixed build. Tokarev's advice is not to use sleep-idle-seconds, or to apply their patch.

medium confidencebest source: vendor, marketingobserved Nov 2026Evidence18:10
flag a problem with BI-FIND-2026-2655
BI-FIND-2026-2653

Tokarev says the team found 30 vulnerabilities in llama.cpp and Ollama, and that the two engines expose about 151,000 unauthenticated servers.

Tokarev says the team's research on llama.cpp and Ollama found 30 vulnerabilities and "we got 11 CVs for those" (the transcript's spelling), and that the two engines together expose about 151,000 unauthenticated servers. The audio gives no scan method or date for that figure. The CVE count holds up against NVD, which we searched: it lists ten llama.cpp records from VulnCheck, all published on 6 August 2026, and one Ollama record, CVE-2026-7482.

low confidencebest source: vendor, marketingobserved Nov 2026Evidence01:03
flag a problem with BI-FIND-2026-2653
BI-FIND-2026-2657

The speakers say llama.cpp's maintainers closed their advisories and the pull requests with their patches unexplained; Ollama opened a pull request for its fix.

The speakers' account of disclosure is that they reported the llama.cpp bugs in July 2025, got no response, and saw their GitHub advisories closed by the maintainers "without any CVs and without any explanations". They say VulnCheck allocated 10 CVEs after they asked in May 2026, and that the patch pull requests they sent llama.cpp in June 2026 were closed without a fix or an explanation. Ollama, told in February 2026, acknowledged the report that month and opened a fix pull request; its CVE came from another CNA. Five vulnerabilities, they say, have not been closed by the vendor, and they offer patches for those. Among their defences for operators are no sleep-idle-seconds, a reverse proxy with TLS authentication in front of the server, and restricted model uploads. For developers, they advise validation and limit checks on sizes from untrusted input such as GGUF tensor shapes, overflow-checked multiplication, and shared pointers in place of raw ones.

low confidencebest source: vendor, marketingobserved Nov 2026Evidence40:19
flag a problem with BI-FIND-2026-2657
02

Part by part

5

showing 5 of 5

[1]

Local inference engines as native-code attack surface

Vladimir Tokarev — 01:03–06:35

AI trust

Tokarev introduces llama.cpp and Ollama as widely used local inference engines, Ollama with about 180,000 GitHub stars, and says the two together expose about 151,000 unauthenticated servers. He reports 30 vulnerabilities and 11 CVEs, found at four boundaries: the Android JNI wrapper, the HTTP server's lifecycle, Ollama's Go and C bindings, and model files an attacker supplies. The team worked by manual review, sanitizers and debuggers.

opinionfrom our transcript

[2]

llama.cpp Android JNI use-after-free, full exploit

Vladimir Tokarev — 07:15–18:08

Tokarev walks through a race in llama.cpp's Android JNI wrapper, where one thread can free the llama_context object while another is still using it, and shows it taken to control of execution in an Android app. He says more than 80 projects use llama.cpp on Android, that the bug is almost two years old, that a lock fixes it, and that VulnCheck assigned its CVE.

technical artifactfrom our transcript

[3]

llama-server sleep-idle-seconds race: remote use-after-free, partial exploit

Vladimir Tokarev — 18:10–30:05

With sleep-idle-seconds on, llama-server frees the idle model while HTTP workers are still tokenizing, and Tokarev shows the freed memory reclaimed by remote requests, with sanitizer and debugger output. They had no remote ASLR bypass, so they stopped short of remote code execution. He calls it plausible on glibc systems and harder on macOS.

technical artifactfrom our transcript

[4]

Ollama GGUF shape: out-of-bounds read and heap leak to a registry

Ofek Itach — 30:18–40:05

Itach shows that Ollama's create path passed a crafted GGUF file's tensor shape on without validation, so the server read past a buffer while converting the model and saved heap memory into it. The model could then be pushed to a registry the attacker runs, and his proof of concept recovered chat data that way. He says more than 30k Ollama servers were open without authentication and that Ollama has fixed the bug.

technical artifactfrom our transcript

[5]

Audit patterns, disclosure timeline and defenses

Vladimir Tokarev — 40:19–45:42

AI trust

Tokarev lists code patterns worth auditing, such as untrusted sizes reaching unsafe or cgo code and raw pointers with no shared ownership. He says the llama.cpp reports of July 2025 went unanswered or were closed, VulnCheck allocated 10 CVEs in May 2026, and their patch pull requests were closed. Ollama acknowledged its report quickly. His defences include a reverse proxy with TLS authentication and restricted model uploads.

opinionfrom our transcript

Terms used

CVE
A public catalogue number for a known, specific software or hardware vulnerability, used to track and reference security flaws consistently across vendors and researchers.
HTTP
Hypertext Transfer Protocol: the request-and-response protocol of the web, in which a client sends a method such as GET or POST to a URL and receives a status code and body.
Remote code execution
A flaw that lets an attacker run their own commands on someone else's machine over the network.
API key
A long-lived secret string that lets software call a service; anyone who copies it can use it until someone revokes it.
TLS
Transport Layer Security, the protocol that encrypts traffic between two systems and lets each check the other's certificate. Mutual TLS (mTLS) makes both sides prove who they are, which is how many workload identity schemes authenticate services.

Read next

Was this briefing useful?

Share this briefing

Every finding, forecast and open question on this site has a permanent ID. If we reword one, its ID stays the same, so a citation keeps pointing to the same claim.

Follow us on LinkedInRSS feed

Working on an identity problem this research touches? Talk to Boston Identity