Skip to content

Insufficient validation of DPoP cnf claim in Local APIs

Low
josephdecock published GHSA-v9xq-2mvm-x8xc Oct 28, 2024

Package

nuget Duende.IdentityServer (NuGet)

Affected versions

>= 7.0.0

Patched versions

7.0.8

Description

Impact

IdentityServer's local API authentication handler performs insufficient validation of the cnf claim in DPoP access tokens. This allows an attacker to use leaked DPoP access tokens at local api endpoints even without possessing the private key for signing proof tokens.

Note that this only impacts custom endpoints within an IdentityServer implementation that have explicitly used the LocalApiAuthenticationHandler for authentication. It does not impact:

  • OAuth or OIDC protocol endpoints defined by IdentityServer, such as the authorize and token endpoints.
  • Typical UI pages within an IdentityServer implementation, which are not normally authorized with the local API authentication handler.
  • The use of DPoP to create sender-constrained tokens in IdentityServer that are consumed by external API resources.
  • The use of DPoP to sender-constrain refresh tokens issued to public clients.

Are you affected?

This vulnerability only affects IdentityServer implementations that are using the local APIs feature of IdentityServer and have explicitly enabled DPoP for local APIs. The local api authentication handler is configured with a call to either AddLocalApi or AddLocalApiAuthentication, and the opt-in to DPoP for local APIs is enabled via the TokenMode option.

Vulnerable implementations of IdentityServer would have configuration code similar to the following:

services.AddAuthentication()
    .AddLocalApi("local", options => 
    {
        options.TokenMode = LocalApiTokenMode.DPoPAndBearer; // or LocalApiTokenMode.DPoPOnly
    });

Patches

This vulnerability is patched in IdentityServer 7.0.8. Version 6.3 and below are unaffected, as they do not support DPoP in Local APIs.

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N

CVE ID

CVE-2024-49755

Weaknesses

No CWEs