CVE-2024-39694: IdentityServer Open Redirect vulnerability in Duende.IdentityServer

Duende.IdentityServer Updated 02 Oct 2025

Summary

31/07/2024
Yes i
Moderate
4.7

CVE-2024-39694: IdentityServer Open Redirect vulnerability. Affects Duende.IdentityServer across 5 version ranges.

>= 6.0.0-preview.1, < 6.0.5 >= 6.1.0-preview.1, < 6.1.8 >= 6.2.0-preview.1, < 6.2.5 >= 6.3.0-preview.1, < 6.3.10 >= 7.0.0-preview.1, < 7.0.6

Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Duende.IdentityServer is an open-source package that provides a framework for building identity and access control solutions for web applications. It is commonly used to implement authentication and authorization mechanisms in ASP.NET Core applications. This package allows developers to secure their applications by integrating with various identity providers and managing user authentication and authorization. However, a vulnerability has been discovered in Duende.IdentityServer that could potentially allow attackers to craft malicious URLs and redirect users to untrusted sites.

Vulnerability Detail

The vulnerability in Duende.IdentityServer allows attackers to create malicious URLs that certain functions in IdentityServer incorrectly treat as local and trusted. When these URLs are returned as redirects, some browsers may follow them to third-party, untrusted sites. Although this vulnerability does not directly expose user credentials or tokens, it can be exploited as part of a phishing attack to steal user credentials. The affected methods include GetAuthorizationContextAsync, IsValidReturnUrl, GetIdentityServerRelativeUrl, ParseAsync, and IsValidReturnUrl.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 6.0.0-preview.1, < 6.0.5 6.0.5
  • >= 6.1.0-preview.1, < 6.1.8 6.1.8
  • >= 6.2.0-preview.1, < 6.2.5 6.2.5
  • >= 6.3.0-preview.1, < 6.3.10 6.3.10
  • >= 7.0.0-preview.1, < 7.0.6 7.0.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading is not feasible, you can use the following code snippet as a workaround to validate return URLs in the user interface code:

// Example code to validate return URLs using IUrlHelper.IsLocalUrl
public IActionResult Login(string returnUrl)
{
    if (Url.IsLocalUrl(returnUrl))
    {
        // Process the login request
        // ...
        return Redirect(returnUrl);
    }

    // Handle invalid return URL
    // ...
}

This code snippet demonstrates how to use the IsLocalUrl method from the IUrlHelper interface to validate the return URL before redirecting the user.

Conclusion

The IdentityServer Open Redirect vulnerability in Duende.IdentityServer allows attackers to craft malicious URLs that can trick the system into redirecting users to untrusted sites. While it does not directly expose sensitive information, it can be exploited in phishing attacks to steal user credentials. Upgrading to the latest version of Duende.IdentityServer is the recommended solution, but if that is not feasible, using the provided workaround can help mitigate the risk.

See every vulnerability recorded for Duende.IdentityServer →

Share this vulnerability

FAQ

The vulnerability allows attackers to craft malicious URLs that can trick IdentityServer into redirecting users to untrusted sites. While it does not directly expose user credentials or tokens, it can be exploited in phishing attacks to steal user credentials.

Versions 7.0.0-preview.1 to 7.0.5, 6.3.0-preview.1 to 6.3.9, 6.2.0-preview.1 to 6.2.4, 6.1.0-preview.1 to 6.1.7, and 6.0.0-preview.1 to 6.0.4 of Duende.IdentityServer are affected by this vulnerability.

Yes, if upgrading is not possible, you can use the IUrlHelper.IsLocalUrl method from ASP.NET Core 5.0 or later to validate return URLs in the user interface code of the IdentityServer host.

Yes, the vulnerability has been fixed in the following versions of Duende.IdentityServer: 7.0.6, 6.3.10, 6.2.5, 6.1.8, and 6.0.5.

Yes, all versions of IdentityServer4 are affected by this vulnerability. It is recommended to upgrade to the latest version of Duende.IdentityServer.

Related vulnerabilities

Recent vulnerabilities recorded for Duende.IdentityServer.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 6.0.0-preview.1, < 6.0.5 6.0.5
  • >= 6.1.0-preview.1, < 6.1.8 6.1.8
  • >= 6.2.0-preview.1, < 6.2.5 6.2.5
  • >= 6.3.0-preview.1, < 6.3.10 6.3.10
  • >= 7.0.0-preview.1, < 7.0.6 7.0.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback