OSV 1.4.0 · github-reviewed · 修改于 2026-07-21 05:18
发布时间
2026-06-06 00:20
GitHub 审查时间
2026-06-06 00:20
NVD 发布时间
2026-06-24 05:17
源文件
advisories/github-reviewed/2026/06/GHSA-8m7c-hf24-5g47/GHSA-8m7c-hf24-5g47.json
Two concurrent token-exchange requests using the same OAuth authorization code could
each mint a distinct valid (access_token, refresh_token) pair, breaking the
single-use guarantee that PKCE relies on.
The token-exchange flow read is_used and called markAsUsed as an unconditional
update at the end of the path. A new OAuthAuthorizationCode.claimByCode method now
performs an atomic compare-and-swap (WHERE code = ? AND is_used = false) and is
called immediately before OAuthToken.insert, after redirect-URI, PKCE, and client
authentication have all succeeded. Only the first concurrent caller's UPDATE wins;
the rest see invalid_grant: Authorization code has already been used.
An attacker who has observed an authorization code and the corresponding PKCE verifier (for example through a malicious OAuth-aware client or by racing a real exchange) could obtain a long-lived refresh token in addition to the legitimate one.
This issue was reported by @eddieran.