ollama - ✅(Solved) Fix server/images: blob hash verification skipped when config and layer share the same digest, leads to SSRF response exfiltration [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15485Fetched 2026-04-11 06:12:28
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Fix Action

Fixed

PR fix notes

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

Description (problem / solution / changelog)

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.

Changed files

  • server/images.go (modified, +2/-6)
  • server/images_test.go (modified, +26/-0)
RAW_BUFFERClick to expand / collapse

What is the issue?

When a manifest contains a config and layer with the same digest, the skipVerify map in PullModel overwrites the false value (set when the layer downloads) with true (set when the config is found already on disk). This causes verifyBlob to be skipped for both entries.

A rogue OCI registry can exploit this by serving a manifest with duplicate digests and redirecting blob downloads via 307 to internal endpoints. The SSRF response is written to disk as a blob, hash verification is skipped due to the map collision, and the blob persists. The attacker can then exfiltrate the response using /api/copy and /api/push.

This would prevent CVE-2026-5530 by preventing arbitrary 307 redirect fetches from being stored on disk.

Relevant log output

OS

macOS

GPU

Apple

CPU

No response

Ollama version

0.20.2

extent analysis

TL;DR

To prevent the SSRF vulnerability, ensure that the skipVerify map in PullModel handles duplicate digests correctly, preventing overwrite of the false value set during layer download.

Guidance

  • Review the PullModel implementation to identify why the skipVerify map overwrites the false value with true when encountering duplicate digests.
  • Modify the skipVerify map to store a list or set of digests instead of a single boolean value to handle duplicate digests correctly.
  • Verify that the fix prevents the SSRF vulnerability by testing with a manifest containing duplicate digests and checking that hash verification is not skipped for both entries.
  • Consider adding additional logging or monitoring to detect potential SSRF attacks.

Example

No code snippet is provided as the issue does not contain sufficient implementation details.

Notes

The provided information suggests a specific vulnerability in the PullModel implementation, but the exact fix may depend on the underlying code and requirements.

Recommendation

Apply a workaround to modify the PullModel implementation to correctly handle duplicate digests, as upgrading to a fixed version is not mentioned in the issue.

FAIL-SAFE

No additional information is required to provide the above guidance, but further details on the PullModel implementation may be necessary to implement a complete fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - ✅(Solved) Fix server/images: blob hash verification skipped when config and layer share the same digest, leads to SSRF response exfiltration [1 pull requests, 1 participants]