CVE-2025-51471: Ollama vulnerable to Cross-Domain Token Exposure
Ollama sends its registry credentials to whatever realm a model server names. A malicious server that answers a pull with a 401 and a crafted WWW-Authenticate header can make Ollama send its token to a host the attacker picks. The package data lists versions up to 0.9.6 and no patched version. A fix was merged upstream in January 2026, but we could not confirm its release.
Published Jul 22, 2025 · Updated Jun 6, 2026 · Analysis Nov 1, 2026
What an attacker can do
When Ollama pulls a model from an HTTPS server and gets a 401, it follows the realm URL in the WWW-Authenticate header. The function server.auth.getAuthorizationToken does not check that the realm is on the same domain as the original request. The attacker runs a server that answers with a 401 naming a realm they control, or naming registry.ollama.ai in the researcher's demo, and gets a victim to pull a model from it, for example through the /api/pull endpoint. Ollama then sends its credentials to the realm and the attacker's server logs the Authorization header.
The attacker needs the victim to pull from their server, so the CVSS vector has user interaction required and high attack complexity. The write-up lists three outcomes: theft of registry.ollama.ai tokens, access to private models the victim can reach, and pushing malicious models under the victim's identity if the victim has write access.
Teams that run Ollama next to coding agents and pull community models from unfamiliar registries are the most exposed. A poisoned model name in a prompt, a config file or a pull script is enough to start the pull.
Who is affected
The package data lists github.com/ollama/ollama at 0.9.6 and below as vulnerable. The original report was for 0.6.7. The researcher's page does not give a version range. You are exposed if the host has Ollama registry credentials and pulls models from servers you do not control.
ollama --version
go list -m github.com/ollama/ollamagithub.com/ollama/ollama
- Ecosystem
- Go
- Affected
- <= 0.9.6
- Fixed in
- No patched version yet
- Check
go list -m github.com/ollama/ollama
How to fix it
The package data lists no patched version. The upstream pull request 10750 was closed unmerged. A maintainer said a stricter change, pull request 13738, titled 'server: reject unexpected auth hosts', was merged on January 16, 2026. An open advisory-database pull request suggests 0.14.3 as the fixed version, but that is not confirmed. Check the Ollama release notes and upgrade to the newest release.
Until you confirm the fixed release, pull models only from registries you trust. Do not pull from a user-supplied server name. Treat any registry token that touched an untrusted pull as exposed and rotate it.
How to tell if you were hit
Review which hosts your Ollama instance pulled from, in server logs and in any pull scripts or agent tool calls that pass a model name. A model reference with a host you do not recognize deserves a look. Check your registry account for token use or model pushes you did not make. On the network, look for Ollama's outbound requests to realm hosts other than the one you pulled from. If an agent can call /api/pull or run ollama pull, Beam records its shell commands and MCP tool calls, so you can check what it pulled.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Cross-Domain Token Exposure in server.auth.getAuthorizationToken in Ollama 0.6.7 allows remote attackers to steal authentication tokens and bypass access controls via a malicious realm value in a WWW-Authenticate header returned by the /api/pull endpoint.
Questions
- Is there a patched Ollama version for CVE-2025-51471?
The package data names none. Upstream merged a fix in pull request 13738 in January 2026, and an advisory-database pull request suggests 0.14.3, but that is unconfirmed in what we read. Check the release notes.
- What does the attacker need?
A malicious HTTPS model server and a victim who pulls a model from it. The server replies 401 with a crafted WWW-Authenticate realm, and Ollama sends its credentials there.
- What can be stolen?
Registry tokens for registry.ollama.ai. With them, an attacker could reach private models and, if the victim has write access, push models under the victim's name.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Ollama vulnerabilities
All Ollama entriesCVE-2026-7482
Ollama contains a heap out-of-bounds read vulnerability in the GGUF model loader
high9.1May 4, 2026CVE-2026-7020
Ollama is Vulnerable to Path Traversal
low5.6No fixApr 26, 2026CVE-2025-63389
Ollama Platform has missing authentication enabling attackers to perform model management operations
critical9.3No fixDec 18, 2025CVE-2025-44779
Ollama allows deletion of arbitrary files
medium6.6Aug 7, 2025CVE-2025-1975
Ollama Server Vulnerable to Denial of Service (DoS) Attack
high7.5No fixMay 16, 2025CVE-2024-12055
Ollama Allows Out-of-Bounds Read
high7.5No fixMar 20, 2025
