Files
Julien Veyssier f89de17264 fix(oauth2): prevent redeeming an unused authorization code via the refresh token grant
The authorization code expiration and redemption state checks only
applied to the authorization_code grant, so an expired but still
unredeemed authorization code could be exchanged for an access token
through the refresh token grant, bypassing the intended 10-minute
expiration until the expired code record was cleaned up.

Require a row to have already delivered a token (token_count > 0)
when rotating through the refresh token grant, enforced atomically in
rotateToken() which already serializes concurrent redemptions through
the hashed_code check.

Assisted-by: OpenCode:GLM-5.3-Flash
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-11-27 10:58:48 +01:00
..