Skip to content

[release/10.0] Harden identity redirect handling in Blazor template - #70833

Merged
wtgodbe merged 1 commit into
release/10.0from
backport/pr-70796-to-release/10.0
Nov 25, 2026
Merged

wtgodbe merged 1 commit into
release/10.0from
backport/pr-70796-to-release/10.0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #70796 to release/10.0

/cc @oroztocil

Harden identity redirect handling in Blazor template

Validate return URLs in the Blazor Identity template's redirect manager

Description

IdentityRedirectManager.RedirectTo in the Blazor Web App template (Individual accounts) checks the raw redirect string, and the check can be bypassed. For example, returnUrl=https://app.example///evil.example redirects to https://evil.example/ after sign-in. This change resolves the URI against the app's base URI and only uses it if the result stays within the app. Anything else redirects to the home page.

Customer Impact

Apps created from the template have an open redirect. A crafted sign-in link can send users to another site after they sign in. Only newly created apps get the fix. Existing apps need to update their copy of IdentityRedirectManager.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Template-only change to one method. Redirects within the app work as before.

Verification

  • Manual (required)
  • Automated

Checked with a generated app in Chrome. Existing template tests cover the valid redirects.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@wtgodbe
wtgodbe merged commit 0ead77d into release/10.0 Nov 25, 2026
33 checks passed
@wtgodbe
wtgodbe deleted the backport/pr-70796-to-release/10.0 branch November 25, 2026 17:45
@dotnet-policy-service dotnet-policy-service Bot added this to the 10.0.14 milestone Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants