{"id":"CVE-2026-47386","aliases":["GHSA-8m7c-hf24-5g47"],"url":"https://o3.security/vulnerability/CVE-2026-47386","summary":"NocoDB: OAuth Authorization Code Race Condition","details":"### 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).","published":"2026-06-23T20:12:13.596Z","modified":"2026-08-12T03:51:44.838214799Z","cvss":null,"epss":{"score":0.00256,"percentile":0.16793,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"nocodb","fixedVersion":"2026.05.1"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47386.json"},{"type":"ADVISORY","url":"https://github.com/nocodb/nocodb/security/advisories/GHSA-8m7c-hf24-5g47"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47386"},{"type":"PACKAGE","url":"https://github.com/nocodb/nocodb"},{"type":"WEB","url":"https://github.com/nocodb/nocodb/releases/tag/2026.05.1"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:44.838214799Z"}}