Abstract
OAuth 2.0 with the Proof Key for Code Exchange (PKCE) extension requires each authorization code to be redeemed only once and each access token to reach the client session that requested it. We used ProVerif to evaluate a model in which several sessions of the same client run in parallel, a code can be presented to the token endpoint repeatedly, and TLS is modeled per connection, so the attacker can open its own connection. Assuming that the server checks and records a used code atomically, ProVerif found no attack on single use, on the secrecy of the access token and code verifier, or on session binding, without an additional session identifier check at the token endpoint; the client still checks state. Without the used-code check, ProVerif found a token-request replay redeeming one code twice, although PKCE verification succeeded; in practice, this corresponds to a request reaching the server twice, such as a client retry. Without PKCE, the attacker obtains a token for an intercepted code, and one client session accepts another session’s token. Therefore, the used-code check and PKCE protect different properties. An injective correspondence detected replay only when its begin event was executed once per issued code.