[PR #7670] [MERGED] feat(oauth-provider): enforce HTTPS for redirect URIs #7483

Closed
opened 2026-03-13 13:38:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7670
Author: @Paola3stefania
Created: 1/29/2026
Status: Merged
Merged: 1/30/2026
Merged by: @himself65

Base: canaryHead: feat/oauth-provider-https-redirect-uri


📝 Commits (4)

📊 Changes

2 files changed (+130 additions, -20 deletions)

View changed files

packages/oauth-provider/src/types/zod.test.ts (+92 -0)
📝 packages/oauth-provider/src/types/zod.ts (+38 -20)

📄 Description

Summary by cubic

Enforces HTTPS for OAuth redirect URIs in oauth-provider, with HTTP allowed only for localhost. Blocks dangerous URL schemes and adds tests for edge cases.

  • New Features

    • Require HTTPS for http/https redirects; HTTP allowed only for localhost, 127.0.0.1, and [::1].
    • Block javascript:, data:, and vbscript: schemes; validate URL is parseable.
    • Allow custom schemes for mobile apps; add tests for subdomain attacks and allowed cases.
  • Migration

Written for commit 28e47d8294. Summary will update on new commits.


🔄 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/better-auth/better-auth/pull/7670 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 1/30/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/oauth-provider-https-redirect-uri` --- ### 📝 Commits (4) - [`e54f831`](https://github.com/better-auth/better-auth/commit/e54f83148f22c8602d9ed10e50c5c24bc71c4f65) feat: safe url - [`240f4fb`](https://github.com/better-auth/better-auth/commit/240f4fbaf19f6a20e47f561f127346508515be43) tests - [`6f340f6`](https://github.com/better-auth/better-auth/commit/6f340f6cf0a43eeef46c677493a0897773e9ceba) fix tests - [`28e47d8`](https://github.com/better-auth/better-auth/commit/28e47d8294fe1e1f49df6ccc4dd47efaf08fa0d2) make lint happy ### 📊 Changes **2 files changed** (+130 additions, -20 deletions) <details> <summary>View changed files</summary> ➕ `packages/oauth-provider/src/types/zod.test.ts` (+92 -0) 📝 `packages/oauth-provider/src/types/zod.ts` (+38 -20) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Enforces HTTPS for OAuth redirect URIs in oauth-provider, with HTTP allowed only for localhost. Blocks dangerous URL schemes and adds tests for edge cases. - **New Features** - Require HTTPS for http/https redirects; HTTP allowed only for localhost, 127.0.0.1, and [::1]. - Block javascript:, data:, and vbscript: schemes; validate URL is parseable. - Allow custom schemes for mobile apps; add tests for subdomain attacks and allowed cases. - **Migration** - Update any non-local HTTP redirect URIs to HTTPS. - For local dev, use http://localhost, http://127.0.0.1, or http://[::1]. <sup>Written for commit 28e47d8294fe1e1f49df6ccc4dd47efaf08fa0d2. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <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-03-13 13:38:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7483