GHSA-55p7-v223-x366: IdentityServer4 IdentityServer Open Redirect Vulnerability Vulnerability

MODERATE
CVSS 4.7
CWE-601
Published
Advisory Summary

GHSA-55p7-v223-x366 is a MODERATE (CVSS 4.7) identityserver open redirect vulnerability vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting IdentityServer4 libraries in the NuGet ecosystem. The issue involves identityserver open redirect vulnerability. Remediation is available in the latest vendor maintenance releases.

GHSA-55p7-v223-x366 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-55p7-v223-x366
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product IdentityServer4
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 4.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-55p7-v223-x366

To remediate this vulnerability, upgrade all affected IdentityServer4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

IdentityServer4 fixed: Latest secure release
Upgrade IdentityServer4 to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for IdentityServer4

How to Check if You Are Affected

To determine whether your application is affected by GHSA-55p7-v223-x366, inspect your project dependencies for IdentityServer4:

inspect dependencies for IdentityServer4

Analyze the terminal output to locate any version of IdentityServer4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In IdentityServer4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. ### 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, and Consent 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 IdentityServer4 is no longer supported and will not be receiving updates. Please consider updating to [Duende.IdentityServer](https://duendesoftware.com).

GHSA-55p7-v223-x366 Affected IdentityServer4 Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
IdentityServer4
NuGet
≤ 4.1.2

References

Frequently Asked Questions

What is GHSA-55p7-v223-x366?
GHSA-55p7-v223-x366 is a security vulnerability in IdentityServer4 involving IdentityServer Open Redirect vulnerability under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which IdentityServer4 versions are affected?
Affected versions include releases prior to current release patches across affected packages: IdentityServer4.
What version fixes GHSA-55p7-v223-x366?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is IdentityServer4 affected?
Yes, IdentityServer4 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-55p7-v223-x366?
GHSA-55p7-v223-x366 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N.
What CWE is associated with GHSA-55p7-v223-x366?
GHSA-55p7-v223-x366 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check NuGet dependencies for GHSA-55p7-v223-x366?
Run the dependency tree command: 'inspect dependencies for IdentityServer4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-55p7-v223-x366",
  "modified" : "2024-07-31T19:57:33Z",
  "published" : "2024-07-31T19:57:33Z",
  "aliases" : [ ],
  "summary" : "IdentityServer Open Redirect vulnerability",
  "details" : "### Impact\nIt 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.\n\n### Affected Methods\n- 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.\n\n   _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, and Consent pages. Customized user interface code might also rely on this behavior. The following uncommonly used APIs are also vulnerable:_\n\n- 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.\n\n### Patches\nIdentityServer4 is no longer supported and will not be receiving updates. Please consider updating to [Duende.IdentityServer](https://duendesoftware.com).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "IdentityServer4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/DuendeSoftware/IdentityServer/security/advisories/GHSA-ff4q-64jc-gx98"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/IdentityServer/IdentityServer4/security/advisories/GHSA-55p7-v223-x366"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39694"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/IdentityServer/IdentityServer4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-31T19:57:33Z",
    "nvd_published_at" : null
  }
}