# CVE-2026-85180: Ollama 0.30.0 through 0.33.2 SSRF via Cross-Host Tensor Blob Redirect

The Markdown version of <https://upatch.dev/cve/CVE-2026-85180>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-85180 is rated High 8.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects Ollama (ollama) and was published on 3 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-85180-ssrf-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-85180 is a server-side request forgery (SSRF) vulnerability in Ollama 0.30.0 through 0.33.2, published on 3 September 2026. When `PullModel` in `server/images.go` pulls a model manifest containing a tensor layer (`application/vnd.ollama.image.tensor`), it delegates blob downloads to `pullWithTransfer`, which invokes `transfer.Download` in `x/transfer/download.go`. In `downloader.resolve`, HTTP `301`, `302` and `307` redirects whose `Location` header points to a different host are returned and followed without checking whether the target resolves to a private, link-local or cloud metadata address. An unauthenticated caller who reaches `POST /api/pull` can point Ollama at a registry that serves a tensor-layer manifest and redirects blob requests to internal hosts or cloud metadata services such as `169.254.169.254`. Upstream commit `7cea5717959d9c424ff8fb906271d31943141505` (fixing issue `#17041`) wraps the transfer HTTP client in `redirectGuard` and rejects cross-host redirects to private, loopback, link-local, multicast and unspecified addresses via `validateRedirectHost` and `blockedRedirectAddr`.

### Official description

Ollama fails to validate redirect destinations when pulling tensor-layer models, allowing unauthenticated attackers to redirect blob downloads to arbitrary hosts. An attacker can control a registry, serve a malicious tensor-layer manifest, and cause the server to issue GET requests to internal hosts including cloud metadata endpoints.

## What the upatch does

The BPF LSM program `cve_2026_85180_ssrf_block` attaches to `lsm/socket_connect` and returns `-EPERM` when a process whose command name or executable is `ollama` attempts to connect an `AF_INET` or `AF_INET6` socket to any of the following internal or non-routable ranges:

- IPv4: `0.0.0.0/8` (unspecified), `10.0.0.0/8`, `100.64.0.0/10` (CGNAT, including `100.100.100.200`), `169.254.0.0/16` (link-local and cloud metadata `169.254.169.254`), `172.16.0.0/12`, `192.168.0.0/16`, `224.0.0.0/4` (multicast) and `240.0.0.0/4`.
- IPv6: `::/128` (unspecified), `fc00::/7` (unique-local, including `fd00:ec2::254`), `fe80::/10` (link-local), `ff00::/8` (multicast), and IPv4-mapped (`::ffff:0:0/96`) or IPv4-compatible (`::/96`) embeddings of the blocked IPv4 ranges.

The program inspects the socket family and destination address first, and checks whether the current task is `ollama` only when the destination falls in a blocked range. Refused connection attempts are counted in the `refused` per-CPU array map.

The policy: [`cve-2026-85180-ssrf-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-85180), 142 lines of BPF C attached at `lsm/socket_connect`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Any `ollama` process on the machine is refused outbound `AF_INET` and `AF_INET6` connections to RFC 1918 private, link-local, cloud metadata, CGNAT, multicast and unspecified addresses.
- Loopback connections (`127.0.0.0/8` and `::1/128`) are permitted so the `ollama` CLI, local runner subprocesses and loopback test registries continue to communicate with the local `ollama serve` daemon on `127.0.0.1:11434`.
- Non-`ollama` processes on the host (including `sshd`, system services, `curl` and `python3`) are unaffected.

## Preemption model and cost

The program keeps no shared state beyond a single per-CPU counter updated with `__sync_fetch_and_add`, so it is safe under every kernel preemption model, including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC` with preemptible RCU, and `PREEMPT_RT`. Connections to public or loopback addresses and non-IP sockets return after reading the address family and destination IP without querying task state or maps.

## Affected versions

This is an application vulnerability in Ollama 0.30.0 through 0.33.2. The upatch runs on any Linux kernel supported by shirudo with BPF LSM and BTF enabled.

## How it was tested

On a vulnerable Ollama 0.30.0 server, the loaded upatch refused the cross-host tensor blob redirect to a link-local address at lsm/socket_connect, while the before and after runs reached the link-local listener.

- **Tested:** 25 Nov 2026
- **Target:** Ollama 0.30.0 (ollama serve) listening on 127.0.0.1:11434
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64

### Results

| State           | Tensor blob redirect to link-local address |
| --------------- | ------------------------------------------ |
| Before loading  | reached                                    |
| Upatch loaded   | blocked                                    |
| After unloading | reached                                    |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-85180
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-85180-1.0.0.bee oci://<registry>/<namespace>/cve-2026-85180 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-85180-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [Ollama issue #17041](https://github.com/ollama/ollama/issues/17041)
- [Fix commit 7cea5717959d9c424ff8fb906271d31943141505](https://github.com/ollama/ollama/commit/7cea571)
- [VulnCheck advisory for CVE-2026-85180](https://www.vulncheck.com/advisories/ollama-0.30.0-through-0.33.2-ssrf-via-cross-host-tensor-blob-redirect)
- [Ollama v0.30.0 release](https://github.com/ollama/ollama/releases/tag/v0.30.0)
- [Ollama v0.33.2 release](https://github.com/ollama/ollama/releases/tag/v0.33.2)

### Links

- [CVE-2026-85180 on upatch.dev](https://upatch.dev/cve/CVE-2026-85180) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-85180)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-85180)
- [CWE-918](https://cwe.mitre.org/data/definitions/918.html)
- Upatch source: [upatches/cve-2026-85180](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-85180)

### More references from NVD (4)

- [github.com](https://github.com/ollama/ollama)
- [github.com](https://github.com/ollama/ollama/blob/v0.33.2/x/transfer/download.go)
- [github.com](https://github.com/ollama/ollama/issues/17041)
- [vulncheck.com](https://www.vulncheck.com/advisories/ollama-0.30.0-through-0.33.2-ssrf-via-cross-host-tensor-blob-redirect)
