Skip to main content

CVE-2024-39694 — Vulnerability in IdentityServer4 — CVE Details

MEDIUM

IdentityServer Open Redirect vulnerability

Published July 31, 2024Updated July 31, 2024Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.82%). Schedule for your next planned update.

Does your project use an affected IdentityServer4 version?

Paste your packages.lock.json to check it for CVE-2024-39694 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my packages.lock.json

Summary

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.

Advisory Timeline

  • First published July 31, 2024 (848 days ago).
  • Last revised July 31, 2024 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update Duende.IdentityServer to 6.0.5 or later
dotnet add package Duende.IdentityServer --version 6.0.5
NuGet
Update Duende.IdentityServer to 6.3.10 or later
dotnet add package Duende.IdentityServer --version 6.3.10
NuGet
Update Duende.IdentityServer to 6.2.5 or later
dotnet add package Duende.IdentityServer --version 6.2.5
NuGet
Update Duende.IdentityServer to 6.1.8 or later
dotnet add package Duende.IdentityServer --version 6.1.8
NuGet
Update Duende.IdentityServer to 7.0.6 or later
dotnet add package Duende.IdentityServer --version 7.0.6

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (6)

Affects 1 ecosystem: NuGet (2).

PackageFixed In
IdentityServer4 NuGet · Affected: 1.0.0, 1.0.0-beta1, 1.0.0-beta1-update1, 1.0.0-beta2 (+77 more)Range-based data available
Duende.IdentityServer NuGet · Affected: 6.0.0, 6.0.1, 6.0.2, 6.0.3 (+1 more)6.0.5
Duende.IdentityServer NuGet · Affected: 6.3.0, 6.3.1, 6.3.2, 6.3.3 (+6 more)6.3.10
Duende.IdentityServer NuGet · Affected: 6.2.0, 6.2.1, 6.2.2, 6.2.3 (+1 more)6.2.5
Duende.IdentityServer NuGet · Affected: 6.1.0, 6.1.1, 6.1.2, 6.1.3 (+4 more)6.1.8
Duende.IdentityServer NuGet · Affected: 7.0.0, 7.0.1, 7.0.2, 7.0.3 (+2 more)7.0.6

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 4.7 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N

Frequently Asked Questions

What is CVE-2024-39694?
IdentityServer Open Redirect vulnerability. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 4.7/10).
How do I check if my project is affected by CVE-2024-39694?
CVE-2024-39694 affects IdentityServer4 and Duende.IdentityServer. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-39694 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
4.7

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.82%
EPSS percentile: 54.4

This is an above-median EPSS score — 54.4% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-ff4q-64jc-gx98

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my packages.lock.json