One Step Off Spec
A browser app runs the authorization code flow with PKCE. Exactly one step below violates the current OAuth 2.0 security best current practice.
1. app -> AS GET /authorize?response_type=code&client_id=northwind-web
&redirect_uri=https://app.northwind.io/cb&state=8fk2
&code_challenge=E9Melhoa2Ow...&code_challenge_method=S256
2. AS authenticates the user, stores the challenge next to the code
3. AS accepts the redirect_uri because it matches the client's
registered pattern https://*.northwind.io/cb
AS -> app 302 https://app.northwind.io/cb?code=SplxlOBeZQ&state=8fk2
4. app compares the returned state to the 8fk2 it stored pre-redirect
5. app -> AS POST /token grant_type=authorization_code&code=SplxlOBeZQ
&redirect_uri=https://app.northwind.io/cb
&client_id=northwind-web&code_verifier=dBjftJeZ4CVP...
6. AS SHA-256 hashes the verifier, base64url encodes it, compares
it to the stored challenge, returns invalid_grant on mismatch
7. AS -> app 200 {"access_token": "...", "refresh_token": "..."}
Which step is the violation?
Sign in to answer questions and track your progress
Sign In