IdentityServer Open Redirect vulnerability
Published 31 Jul 2024 · Updated 30 Nov 2024
Is your project on an affected IdentityServer4?
Look after several .NET apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <=4.1.2
- Fixed in
- No fix released
Details
Impact
It is possible for an attacker to craft malicious Urls that certain functions in IdentityServer will incorrectly treat as local and trusted. If such a Url is returned as a redirect, some browsers will follow it to a third-party, untrusted site.
Affected Methods
- In the
DefaultIdentityServerInteractionService, theGetAuthorizationContextAsyncmethod may return non-null and theIsValidReturnUrlmethod may return true for malicious Urls, indicating incorrectly that they can be safely redirected to.
_UI code calling these two methods is the most commonly used code path that will expose the vulnerability. The default UI templates rely on this behavior in the Login, Challenge, and Consent pages. Customized user interface code might also rely on this behavior. The following uncommonly used APIs are also vulnerable:_
- The
ServerUrlExtensions.GetIdentityServerRelativeUrl,ReturnUrlParser.ParseAsyncandOidcReturnUrlParser.ParseAsyncmethods may incorrectly return non-null, and theReturnUrlParser.IsValidReturnUrlandOidcReturnUrlParser.IsValidReturnUrlmethods may incorrectly return true for malicious Urls.
Patches
IdentityServer4 is no longer supported and will not be receiving updates. Please consider updating to Duende.IdentityServer.
Is GHSA-55p7-v223-x366 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected IdentityServer4, and gives you the command that fixes it.
More advisories for IdentityServer4
- MediumCVE-2024-39694IdentityServer Open Redirect vulnerability · 31 Jul 2024
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.