HTTP Client uses incorrect token after refresh
Moderate severity
GitHub Reviewed
Published
Nov 7, 2024
in
DuendeSoftware/Duende.AccessTokenManagement
•
Updated Nov 8, 2024
Package
Affected versions
= 3.0.0
Patched versions
3.0.1
Description
Published to the GitHub Advisory Database
Nov 7, 2024
Reviewed
Nov 7, 2024
Published by the National Vulnerability Database
Nov 8, 2024
Last updated
Nov 8, 2024
Impact
HTTP Clients created by
AddUserAccessTokenHttpClient
may use a different user's access token after a token refresh. This occurs because a refreshed token will be captured in pooledHttpClient
instances, which may be used by a different user.Workarounds
Instead of using
AddUserAccessTokenHttpClient
to create anHttpClient
that automatically adds a managed token to outgoing requests, you can use theHttpConext.GetUserAccessTokenAsync
extension method or theIUserTokenManagementService.GetAccessTokenAsync
method.Patches
This issue is fixed in Duende.AccessTokenManagement.OpenIdConnect 3.0.1.
References