Skip to content

OIDC and Blazor WebAssembly Identity articles show return URL handling that allows open redirects #38217

In review

Description

@oroztocil

Two articles show return URL handling that allows open redirects, and the open redirect guidance doesn't cover Blazor.

Example: the Login page in the OIDC article passes ReturnUrl=//evil.example through as the redirect URI, so the OIDC handler sends users to that site after they sign in.

Affected:

  • security/authentication/configure-oidc-web-authentication.md, "Implement Login page", and the oidc-net8/RazorPageOidc sample: GetAuthProperties passes //evil.example through and reduces https://host//evil.example to //evil.example.
  • blazor/security/webassembly/standalone-with-identity/qrcodes-for-authenticator-apps.md, "Replace Login component": the component navigates to ReturnUrl without checking it, which also lets javascript: URLs run script. The sample it's copied from is tracked in Blazor samples use return URLs without validating them blazor-samples#692.
  • security/preventing-open-redirects.md: no Blazor guidance. NavigationManager.NavigateTo doesn't check destinations, Blazor doesn't block javascript: URLs in links, and Blazor return URLs are often absolute, so IsLocalUrl doesn't fit.

The Blazor guidance should follow the code in dotnet/aspnetcore#70796, tracked by dotnet/aspnetcore#70797.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions