[PR #22415] [MERGED] fix: URL-encode OAuth error message in redirect URL #42302

Closed
opened 2026-04-25 14:15:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22415
Author: @gambletan
Created: 3/8/2026
Status: Merged
Merged: 3/8/2026
Merged by: @tjbck

Base: devHead: fix/oauth-error-url-encode


📝 Commits (1)

  • 8e81e9d fix: URL-encode OAuth error message in redirect URL

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 backend/open_webui/utils/oauth.py (+1 -1)

📄 Description

Description

  • In the OAuth error handling flow, the error message was inserted directly into the redirect URL without URL-encoding. When the error message contained special characters (spaces, ampersands, etc.), it produced a malformed redirect URL that could break the redirect or lose parts of the error message.

Fixed

  • URL-encoded the OAuth error message before inserting it into the redirect URL, ensuring the redirect works correctly regardless of special characters in the error message.

Additional Information

  • Tested by reviewing the code path and verifying the fix addresses the issue
  • Self-reviewed the code changes

Contributor License Agreement


🔄 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/open-webui/open-webui/pull/22415 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/oauth-error-url-encode` --- ### 📝 Commits (1) - [`8e81e9d`](https://github.com/open-webui/open-webui/commit/8e81e9dd030187c65e5fd12b86a2cbd696e8ff47) fix: URL-encode OAuth error message in redirect URL ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/oauth.py` (+1 -1) </details> ### 📄 Description ### Description - In the OAuth error handling flow, the error message was inserted directly into the redirect URL without URL-encoding. When the error message contained special characters (spaces, ampersands, etc.), it produced a malformed redirect URL that could break the redirect or lose parts of the error message. ### Fixed - URL-encoded the OAuth error message before inserting it into the redirect URL, ensuring the redirect works correctly regardless of special characters in the error message. ### Additional Information - Tested by reviewing the code path and verifying the fix addresses the issue - Self-reviewed the code changes ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <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-25 14:15:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#42302