I’m really struggling to wrap my head around this. I have a hypothetical flow, which includes 3 entities: The user/browser, AuthServer, client/App. This flow makes use authorisation code flow with PKCE. Here are the steps:
- User clicks sign in
- client/app generates code challenge and verifier. Redirects user to AuthServer
- user follows redirect to AuthServer including the code challenge. The AuthServer stores this for later validation.
- Authserver responds with Login prompt
- User authenticates successfully
- Authserver sends back Authcode to user browser via redirect to client
- User browser sends AuthCode to Client/App
- Client/ App trades this code with AuthServer for ID token, it uses the verifier from earlier, plus client secret.
- Client/App sends ID token to user and establishes a session
Now for the attack scenario: Say that the user is an employee at a company, that uses a webproxy, and this webproxy intercepts and terminates, and stores all TLS traffic going between it. And a privileged admin had access to this proxy and had malicious intent – what would stop this admin from replaying the request in step 6, and basically hijacking the authentication and stealing the resulting token? I don’t see how PKCE would help here, since that is just verifying the client in this case, and the client is still correct.