NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · NuGet

CVE-2024-39694: IdentityServer Open Redirect vulnerability

mediumCVSS 4.0 5.1 · 3.1 4.7GHSA-ff4q-64jc-gx98

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.

Published Jul 31, 2024

Affected packages

Duende.IdentityServer

Ecosystem
NuGet
Affected
>= 7.0.0-preview.1, <= 7.0.5
Fixed in
7.0.6
Check
dotnet list package --include-transitive

Duende.IdentityServer

Ecosystem
NuGet
Affected
>= 6.3.0-preview.1, <= 6.3.9
Fixed in
6.3.10
Check
dotnet list package --include-transitive

Duende.IdentityServer

Ecosystem
NuGet
Affected
>= 6.2.0-preview.1, <= 6.2.4
Fixed in
6.2.5
Check
dotnet list package --include-transitive

Duende.IdentityServer

Ecosystem
NuGet
Affected
>= 6.1.0-preview.1, <= 6.1.7
Fixed in
6.1.8
Check
dotnet list package --include-transitive

Duende.IdentityServer

Ecosystem
NuGet
Affected
>= 6.0.0-preview.1, <= 6.0.4
Fixed in
6.0.5
Check
dotnet list package --include-transitive

IdentityServer4

Ecosystem
NuGet
Affected
<= 4.1.2
Fixed in
No patched version yet
Check
dotnet list package --include-transitive

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More NuGet vulnerabilities

All NuGet entries