GHSA-ff4q-64jc-gx98

Suggest an improvement
Source
https://github.com/advisories/GHSA-ff4q-64jc-gx98
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/07/GHSA-ff4q-64jc-gx98/GHSA-ff4q-64jc-gx98.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-ff4q-64jc-gx98
Aliases
Published
2024-07-31T15:28:54Z
Modified
2024-07-31T20:13:36.853973Z
Severity
  • 4.7 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N CVSS Calculator
  • 5.1 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
IdentityServer Open Redirect vulnerability
Details

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.

Database specific
{
    "nvd_published_at": "2024-07-31T16:15:04Z",
    "cwe_ids": [
        "CWE-601"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2024-07-31T15:28:54Z"
}
References

Affected packages

NuGet / Duende.IdentityServer

Package

Name
Duende.IdentityServer
View open source insights on deps.dev
Purl
pkg:nuget/Duende.IdentityServer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
7.0.0-preview.1
Fixed
7.0.6

Affected versions

7.*

7.0.0
7.0.1
7.0.2
7.0.3
7.0.4
7.0.5

Database specific

{
    "last_known_affected_version_range": "<= 7.0.5"
}

NuGet / Duende.IdentityServer

Package

Name
Duende.IdentityServer
View open source insights on deps.dev
Purl
pkg:nuget/Duende.IdentityServer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.3.0-preview.1
Fixed
6.3.10

Affected versions

6.*

6.3.0
6.3.1
6.3.2
6.3.3
6.3.4
6.3.5
6.3.6
6.3.7
6.3.8
6.3.9

Database specific

{
    "last_known_affected_version_range": "<= 6.3.9"
}

NuGet / Duende.IdentityServer

Package

Name
Duende.IdentityServer
View open source insights on deps.dev
Purl
pkg:nuget/Duende.IdentityServer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.2.0-preview.1
Fixed
6.2.5

Affected versions

6.*

6.2.0
6.2.1
6.2.2
6.2.3
6.2.4

Database specific

{
    "last_known_affected_version_range": "<= 6.2.4"
}

NuGet / Duende.IdentityServer

Package

Name
Duende.IdentityServer
View open source insights on deps.dev
Purl
pkg:nuget/Duende.IdentityServer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.1.0-preview.1
Fixed
6.1.8

Affected versions

6.*

6.1.0
6.1.1
6.1.2
6.1.3
6.1.4
6.1.5
6.1.6
6.1.7

Database specific

{
    "last_known_affected_version_range": "<= 6.1.7"
}

NuGet / Duende.IdentityServer

Package

Name
Duende.IdentityServer
View open source insights on deps.dev
Purl
pkg:nuget/Duende.IdentityServer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.0.0-preview.1
Fixed
6.0.5

Affected versions

6.*

6.0.0
6.0.1
6.0.2
6.0.3
6.0.4

Database specific

{
    "last_known_affected_version_range": "<= 6.0.4"
}

NuGet / IdentityServer4

Package

Name
IdentityServer4
View open source insights on deps.dev
Purl
pkg:nuget/IdentityServer4

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
4.1.2

Affected versions

1.*

1.0.0-beta1
1.0.0-beta1-update1
1.0.0-beta2
1.0.0-beta2-update1
1.0.0-beta2-update2
1.0.0-beta3
1.0.0-beta4
1.0.0-beta4-update1
1.0.0-beta4-update2
1.0.0-beta5
1.0.0-rc1
1.0.0-rc1-update1
1.0.0-rc1-update2
1.0.0-rc2
1.0.0-rc3
1.0.0-rc4
1.0.0-rc4-update1
1.0.0-rc5
1.0.0
1.0.1
1.0.2
1.1.0
1.1.1
1.2.0
1.2.1
1.3.0
1.3.1
1.4.0
1.4.1
1.4.2
1.5.0
1.5.1
1.5.2
1.5.3

2.*

2.0.0-preview2
2.0.0-preview3
2.0.0-preview4
2.0.0-rc1
2.0.0-rc1-update1
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6-preview1
2.0.6
2.1.0
2.1.1
2.1.2
2.1.3
2.2.0
2.3.0-preview1
2.3.0-preview1-update1
2.3.0-preview1-update2
2.3.0-preview2
2.3.0
2.3.1
2.3.2
2.4.0-preview1
2.4.0
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4

3.*

3.0.1
3.0.2
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4

4.*

4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
4.1.0
4.1.1
4.1.2