{"id":"GHSA-8m7c-hf24-5g47","revision":"f45f6002954b4c6886036f37e65c87f1","records":[{"revision":"f45f6002954b4c6886036f37e65c87f1","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-8m7c-hf24-5g47","aliases":["CVE-2026-47386"],"title":"NocoDB: OAuth Authorization Code Race Condition","description":"### Summary\nTwo concurrent token-exchange requests using the same OAuth authorization code could\neach mint a distinct valid `(access_token, refresh_token)` pair, breaking the\nsingle-use guarantee that PKCE relies on.\n\n### Details\nThe token-exchange flow read `is_used` and called `markAsUsed` as an unconditional\nupdate at the end of the path. A new `OAuthAuthorizationCode.claimByCode` method now\nperforms an atomic compare-and-swap (`WHERE code = ? AND is_used = false`) and is\ncalled immediately before `OAuthToken.insert`, after redirect-URI, PKCE, and client\nauthentication have all succeeded. Only the first concurrent caller's `UPDATE` wins;\nthe rest see `invalid_grant: Authorization code has already been used`.\n\n### Impact\nAn attacker who has observed an authorization code and the corresponding PKCE\nverifier (for example through a malicious OAuth-aware client or by racing a real\nexchange) could obtain a long-lived refresh token in addition to the legitimate one.\n\n### Credit\nThis issue was reported by [@eddieran](https://github.com/eddieran).","state":0,"publishedAt":"2026-06-05T16:20:32+00:00","modifiedAt":"2026-07-20T21:30:33.4247865+00:00","affected":[{"ecosystem":"npm","name":"nocodb","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2026.05.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/nocodb/nocodb/security/advisories/GHSA-8m7c-hf24-5g47","https://nvd.nist.gov/vuln/detail/CVE-2026-47386","https://github.com/nocodb/nocodb","https://github.com/nocodb/nocodb/releases/tag/2026.05.1"],"sourceUrl":"https://github.com/advisories/GHSA-8m7c-hf24-5g47","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-8m7c-hf24-5g47","identifiers":["GHSA-8m7c-hf24-5g47","CVE-2026-47386"]},"retained":false,"historicalAffected":[]}],"coverage":[]}