Skip to content

Occasional Code_Verifier mismatch #1445

Open
@AndersAbel

Description

@AndersAbel

I'm investigating an issue reported by a Duende IdentityServer customer where they get occasional errors logged in IdentityServer on the token endpoint: "Transformed code verifier does not match code challenge"

The client application is typically opened in multiple tabs on the same time in the same browser.

Upon reviewing the logs I can see that this happens when the client makes two silent token renewals on the same time.

  1. Call A to authorize endpoint with code_challenge=X
  2. Call B to authorize endpoint with code_challenge=Y
  3. Call to token endpoint which results in "Transformed code verifier does not match code challenge". When we hash the code_verifier from this call, it matches code_challenge X, from call A to the authorize endpoint.

Right now we do not have logs of the generated authorization code from the responses from the authorize endpoints, but it looks like the code_verifier for call A to the authorize endpoint together with the authorization returned from B (or the other way around).

We have two questions:

  1. Is there a way when running the application in multiple tabs to prevent multiple refreshes running on the same time?
  2. Could there be a bug in the state handling in this library that mixes up the code_verifiers when there are two simultaneous calls?

Desktop (please complete the following information):

  • Multiple browsers, both Safari and Chrome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions