[PR #15486] server/images: always verify blob hashes regardless of cache hit #15170

Open
opened 2026-04-13 01:11:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15486
Author: @davidrxchester
Created: 4/10/2026
Status: 🔄 Open

Base: mainHead: fix-skipverify-bypass


📝 Commits (1)

  • 6a9c9e9 server/images: always verify blob hashes regardless of cache hit

📊 Changes

2 files changed (+28 additions, -6 deletions)

View changed files

📝 server/images.go (+2 -6)
📝 server/images_test.go (+26 -0)

📄 Description

Fixes #15485

Removes the skipVerify map from PullModel and verifies all blobs unconditionally.

When a manifest uses the same digest for config and layer, the map value gets overwritten from false to true, causing hash verification to be skipped. Combined with the 307 redirect behavior in blob downloads, a rogue OCI registry can redirect blob fetches to internal endpoints. The response is written to disk and persists because verification is skipped. An attacker can then exfiltrate the response via /api/copy and/api/push.

This fix ensures all blobs are verified regardless of cache state, so SSRF responses that don't match the advertised digest are deleted.

Test included.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15486 **Author:** [@davidrxchester](https://github.com/davidrxchester) **Created:** 4/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-skipverify-bypass` --- ### 📝 Commits (1) - [`6a9c9e9`](https://github.com/ollama/ollama/commit/6a9c9e9bb4f6d4e1275d2f4049a6c43bd90ce0f4) server/images: always verify blob hashes regardless of cache hit ### 📊 Changes **2 files changed** (+28 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+2 -6) 📝 `server/images_test.go` (+26 -0) </details> ### 📄 Description Fixes #15485 Removes the `skipVerify` map from `PullModel` and verifies all blobs unconditionally. When a manifest uses the same digest for config and layer, the map value gets overwritten from false to true, causing hash verification to be skipped. Combined with the 307 redirect behavior in blob downloads, a rogue OCI registry can redirect blob fetches to internal endpoints. The response is written to disk and persists because verification is skipped. An attacker can then exfiltrate the response via /api/copy and/api/push. This fix ensures all blobs are verified regardless of cache state, so SSRF responses that don't match the advertised digest are deleted. Test included. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 01:11:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#15170