The vulnerability is a race condition caused by an improper caching strategy for Fetcher objects within the Auth0 Next.js SDK's proxy handlers. When DPoP is enabled, these handlers are used to make authenticated API requests. The root cause was that the entire Fetcher object, which contains request-specific state like DPoP nonces and access token closures, was being cached and shared across concurrent requests for the same resource audience.
The vulnerable function AuthClientProvider.getProxyFetcher and the corresponding logic within AuthClient.proxy would return a cached Fetcher instance. If two users made requests to a proxied endpoint at the same time, they could end up sharing the same Fetcher instance. If one of those requests triggered a DPoP nonce retry, the state of that Fetcher would be modified. The second request, using this same modified Fetcher, would then proceed with incorrect state, leading to potential session corruption or one user's request being processed with another user's authorization context.
The patch resolves this by changing the caching strategy. Instead of caching the entire Fetcher, only the DPoPHandle (which manages nonce state) is cached per audience. The AuthClient.proxy method was refactored to create a new, request-specific Fetcher for every call, which is then initialized with the shared DPoPHandle. This ensures that while the DPoP nonce state is correctly maintained across retries for a given context, the request-specific state is isolated, thus eliminating the race condition.