GitHub OAuth Redirect Fragments Are Out. Wildcards Are the Bigger Fix

A developer's desk at night with a notebook of diagram sketches

GitHub OAuth redirect URIs that carry a # fragment have an expiry date. Starting February 1, 2027, GitHub will reject OAuth authorization requests that use a redirect URI containing a URL fragment, and developers will no longer be able to register one.

Updated December 1, 2026

Key Takeaways

  • GitHub will reject OAuth redirect URIs with a # fragment starting February 1, 2027.
  • The change covers github.com Free, Team and Enterprise Cloud, not Enterprise Server.
  • All OAuth apps created before August 3, 2026 have wildcard callback matching on by default.
  • RFC 9700 calls for exact redirect URI matching, so disable wildcards you don’t need.

The fix is small. But the same GitHub documentation that announces the change also confirms a riskier default many teams have never looked at: all OAuth apps and some GitHub Apps created before August 3, 2026 have wildcard callback matching switched on. If you are opening your app settings to strip a fragment, that is the setting worth changing too.

What Changes for GitHub OAuth Redirect URIs

In its changelog notice, GitHub says fragments are not part of the OAuth 2.0 specification, citing RFC 6749 section 3.1.2.3, and that they introduce a security risk, since a fragment can be used to intercept an authorization code or token during a redirect.

Until enforcement, app owners see a warning in settings, and users signing in through an affected app will see a caution message. After it, sign-ins that use a fragment fail.

  • Who is affected: GitHub Apps and OAuth apps on github.com across the Free, Team, and Enterprise Cloud plans.
  • Who is not: GitHub Enterprise Server.
  • What breaks: callback URLs that end in something like /callback#section.

GitHub’s OAuth app documentation spells out the remedy: remove any fragments from your app’s callback URLs and redirect_uri values. Remember that redirect_uri is optional. If you leave it out, GitHub sends users to the first callback URL in your app settings, so a fragment there breaks sign-in even if your code never passes one.

Why Fragments Are Risky

The IETF’s OAuth 2.0 Security Best Current Practice, published as RFC 9700 in January 2025, explains the mechanics. It notes that user agents reattach fragments to the destination URL of a redirect if the location header does not contain a fragment. Combined with an open redirector, that behavior can carry a token to an attacker’s page.

The document also says the way browsers treat fragments when redirecting has changed, and with it the implicit grant’s security model. It warns that response types that issue tokens in the authorization response are vulnerable to access token leakage and replay.

The Bigger Fix: Turn Off Wildcard Matching

GitHub’s callback URL documentation explains that when wildcard matching is enabled, any subdomain or subdirectory of the callback URL will match and be allowed. GitHub itself warns:

“Enabling wildcard matching can expose your app to security risks, because it allows an attacker to send authorization codes to any subdomain or subdirectory of the callback URL.”

Here is the catch. Apps that had a single callback URL before August 3, 2026 have wildcard matching enabled to preserve their old behavior. GitHub says that is why all OAuth apps and some GitHub Apps created before that date have it on, and it recommends disabling it if you do not need it.

RFC 9700 is blunt on this point. It says authorization servers MUST utilize exact string matching except for port numbers in localhost redirection URIs of native apps. It also describes how a wildcard pattern fails: if an attacker manages to establish a host or subdomain in the domain, the attacker can impersonate the legitimate client, for example through a subdomain takeover attack.

Setting What GitHub accepts Risk
Fragment in callback Rejected from February 1, 2027 Code or token interception
Wildcard matching on Any subdomain or subdirectory Codes sent to a host you may not control
Wildcard matching off Exact match only Lowest

A Developer Checklist

  1. Audit callbacks. GitHub Apps can list up to 10 callback URLs. Check each one for a #.
  2. Move post-login navigation into your app. If you used a fragment to land users on a tab or section, store that target in your session and redirect after the token exchange.
  3. Disable wildcard matching unless you control every subdomain and path. With it off, the redirect URL must exactly match the callback URL.
  4. Use PKCE and state. GitHub strongly recommends both. Its code challenge must be S256, since the plain method is not supported, and state should be an unguessable random string to protect against cross-site request forgery.
  5. Test before February. Watch for the caution message in your own sign-in flow.

In our view, the fragment deadline is the easy part. The wildcard default is the setting that would matter after a forgotten subdomain or a dangling DNS record, and it takes one toggle to fix. For more on locking down GitHub-connected pipelines, see our GitHub token audit checklist.

Frequently asked questions

When does GitHub stop accepting redirect URI fragments?

Starting February 1, 2027, GitHub will reject OAuth authorization requests that use a redirect URI containing a URL fragment.

Does the change affect GitHub Enterprise Server?

No. GitHub says it applies to github.com across the Free, Team, and Enterprise Cloud plans only.

Should I turn off wildcard callback matching?

GitHub recommends disabling it if your app does not need it, because it lets codes go to any subdomain or subdirectory of the callback URL.

Notice an error?

Help us improve our content by reporting any issues you find.