[PR #13738] [MERGED] server: reject unexpected auth hosts #40244

Closed
opened 2026-04-23 01:11:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13738
Author: @BruceMacD
Created: 1/16/2026
Status: Merged
Merged: 1/16/2026
Merged by: @BruceMacD

Base: mainHead: brucemacd/cross-domain-check


📝 Commits (2)

📊 Changes

4 files changed (+123 additions, -5 deletions)

View changed files

📝 server/auth.go (+6 -1)
server/auth_test.go (+113 -0)
📝 server/images.go (+3 -3)
📝 server/upload.go (+1 -1)

📄 Description

Added validation to ensure auth redirects stay on the same host as the original request. The fix is a single check in getAuthorizationToken comparing the realm URL's host against the request host. Added tests for the auth flow.

This builds on #10750, but is more strict than just suffix matching.


🔄 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/13738 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/cross-domain-check` --- ### 📝 Commits (2) - [`fc238ec`](https://github.com/ollama/ollama/commit/fc238ec48575324d3aabdf948c262301250bce04) server: reject unexpected auth hosts - [`add4e19`](https://github.com/ollama/ollama/commit/add4e1909bc4a2b312a8cad8b928a272bd487247) gofmt ### 📊 Changes **4 files changed** (+123 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `server/auth.go` (+6 -1) ➕ `server/auth_test.go` (+113 -0) 📝 `server/images.go` (+3 -3) 📝 `server/upload.go` (+1 -1) </details> ### 📄 Description Added validation to ensure auth redirects stay on the same host as the original request. The fix is a single check in getAuthorizationToken comparing the realm URL's host against the request host. Added tests for the auth flow. This builds on #10750, but is more strict than just suffix matching. --- <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-23 01:11:30 -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#40244