CVE-2024-39694
JSON

4.7medium

Duende IdentityServer Open Redirect vulnerability

Severity
4.7medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.53% (higher than 46% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-ff4q-64jc-gx98

Description

Duende IdentityServer is an OpenID Connect and OAuth 2.x framework for ASP.NET Core. 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. This vulnerability is fixed in 7.0.6, 6.3.10, 6.2.5, 6.1.8, and 6.0.5. Duende.IdentityServer 5.1 and earlier and all versions of IdentityServer4 are no longer supported and will not be receiving updates. If upgrading is not possible, use `IUrlHelper.IsLocalUrl` from ASP.NET Core to validate return Urls in user interface code in the IdentityServer host.

Affected

Product or packageVersionsReported by
DuendeSoftware IdentityServer< 6.0.5, >= 6.1.0-preview.1, <= 6.1.7, >= 6.2.0-preview.1, <= 6.2.4, >= 6.3.0-preview.1, <= 6.3.9, >= 7.0.0-preview.1, <= 7.0.5CVE List
Duende.IdentityServer (NuGet)from 7.0.0-preview.1 before 7.0.6, from 6.3.0-preview.1 before 6.3.10, from 6.2.0-preview.1 before 6.2.5, from 6.1.0-preview.1 before 6.1.8, from 6.0.0-preview.1 before 6.0.5GitHub Advisory Database
IdentityServer4 (NuGet)up to 4.1.2GitHub Advisory Database

All scores

GitHub_M4.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
GitHub4.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N

Classification

CWE-601

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Duende IdentityServer is an OpenID Connect and OAuth 2.x framework for ASP.NET Core. 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. This vulnerability is fixed in 7.0.6, 6.3.10, 6.2.5, 6.1.8, and 6.0.5. Duende.IdentityServer 5.1 and earlier and all versions of IdentityServer4 are no longer supported and will not be receiving updates. If upgrading is not possible, use `IUrlHelper.IsLocalUrl` from ASP.NET Core to validate return Urls in user interface code in the IdentityServer host.

GitHub Advisory Database
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.

NVD (es)

Duende IdentityServer es un framework OpenID Connect y OAuth 2.x para ASP.NET Core. Es posible que un atacante cree URL maliciosas que ciertas funciones de IdentityServer traten incorrectamente como locales y confiables. Si dicha URL se devuelve como redireccionamiento, algunos navegadores la seguirán hasta un sitio de terceros que no es de confianza. Nota: por sí sola, esta vulnerabilidad **no** permite que un atacante obtenga credenciales de usuario, códigos de autorización, tokens de acceso, tokens de actualización o tokens de identidad. Sin embargo, un atacante podría aprovechar esta vulnerabilidad como parte de un ataque de phishing diseñado para robar las credenciales de los usuarios. Esta vulnerabilidad se solucionó en 7.0.6, 6.3.10, 6.2.5, 6.1.8 y 6.0.5. Duende.IdentityServer 5.1 y anteriores y todas las versiones de IdentityServer4 ya no son compatibles y no recibirán actualizaciones. Si no es posible realizar la actualización, use `IUrlHelper.IsLocalUrl` de ASP.NET Core para validar las URL de retorno en el código de la interfaz de usuario en el host IdentityServer.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-39694 changed 2024-07-31CVE Terms of Use
GitHub Advisory DatabaseGHSA-ff4q-64jc-gx98 changed 2024-07-31CC-BY-4.0
NVDCVE-2024-39694 changed 2026-06-17Public domain