GHSA-ff4q-64jc-gx98
IdentityServer Open Redirect vulnerability
Quick fix
GHSA-ff4q-64jc-gx98 — Duende.IdentityServer: upgrade to the fixed version with the command below.
dotnet add package Duende.IdentityServer --version 7.0.6Details
### 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.
_Note: by itself, this vulnerability does **not** allow an attacker to obtain user credentials, authorization codes, access tokens, refresh tokens, or identity tokens. An attacker could however exploit this vulnerability as part of a phishing attack designed to steal user credentials._
### Affected Methods - In the `DefaultIdentityServerInteractionService`, the `GetAuthorizationContextAsync` method may return non-null and the `IsValidReturnUrl` method 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, Consent, and Account Creation pages. Customized user interface code might also rely on this behavior. The following uncommonly used APIs are also vulnerable:_
- The `ServerUrlExtensions.GetIdentityServerRelativeUrl`, `ReturnUrlParser.ParseAsync` and `OidcReturnUrlParser.ParseAsync` methods may incorrectly return non-null, and the `ReturnUrlParser.IsValidReturnUrl` and `OidcReturnUrlParser.IsValidReturnUrl` methods may incorrectly return true for malicious Urls.
### Patches This vulnerability is fixed in the following versions of Duende.IdentityServer: - 7.0.6 - 6.3.10 - 6.2.5 - 6.1.8 - 6.0.5
Duende.IdentityServer 5.1 and earlier and all versions of IdentityServer4 are no longer supported and will not be receiving updates.
### Workarounds
If upgrading is not possible, use `IUrlHelper.IsLocalUrl` from ASP.NET Core 5.0 or later to validate return Urls in user interface code in the IdentityServer host.
Are you affected?
Enter the version of the package you're using.
Affected packages
7.0.0-preview.1Fixed in: 7.0.6dotnet add package Duende.IdentityServer --version 7.0.66.3.0-preview.1Fixed in: 6.3.10dotnet add package Duende.IdentityServer --version 6.3.106.2.0-preview.1Fixed in: 6.2.5dotnet add package Duende.IdentityServer --version 6.2.56.1.0-preview.1Fixed in: 6.1.8dotnet add package Duende.IdentityServer --version 6.1.86.0.0-preview.1Fixed in: 6.0.5dotnet add package Duende.IdentityServer --version 6.0.50No fixed version published yet for IdentityServer4 (nuget). Pin to a known-safe version or switch to an alternative.
References
- https://github.com/DuendeSoftware/IdentityServer/security/advisories/GHSA-ff4q-64jc-gx98[WEB]
- https://github.com/IdentityServer/IdentityServer4/security/advisories/GHSA-55p7-v223-x366[WEB]
- https://nvd.nist.gov/vuln/detail/CVE-2024-39694[ADVISORY]
- https://github.com/DuendeSoftware/IdentityServer/commit/269ca2171fe1e901c87f2f0797bbc7c230db87c6[WEB]
- https://github.com/DuendeSoftware/IdentityServer/commit/765116a2d4fb0671b6eba015e698533900c61c8e[WEB]
- https://github.com/DuendeSoftware/IdentityServer/commit/d0d8eab35ad9183b14925496803ed8b36658d0a1[WEB]
- https://github.com/DuendeSoftware/IdentityServer/commit/f04cf0be859b93f43563f8f812eb92206ad94011[WEB]
- https://github.com/DuendeSoftware/IdentityServer/commit/fe817b499933d6ed6141b153492d7335c28b184a[WEB]
- https://github.com/DuendeSoftware/IdentityServer[PACKAGE]