{"id":"CVE-2026-47386","aliases":["CVE-2026-47386","GHSA-8m7c-hf24-5g47"],"related":[],"kind":"vulnerability","state":"published","title":"NocoDB: OAuth Authorization Code Race Condition","summary":"NocoDB is software for building databases as spreadsheets. Prior to 2026.05.1, 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. This vulnerability is fixed in 2026.05.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"NocoDB is software for building databases as spreadsheets. Prior to 2026.05.1, 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. This vulnerability is fixed in 2026.05.1.","source":"cvelist"},{"lang":"en","text":"### 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).","format":"markdown","source":"ghsa"}],"published":"2026-06-05T16:20:32.000Z","modified":"2026-07-20T21:30:33.424Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"}],"cwes":["CWE-362"],"affected":[{"ranges":[{"version":"< 2026.05.1","status":"affected"}],"vendor":"nocodb","product":"nocodb","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2026.05.1"}],"ecosystem":"npm","package":"nocodb","purl":"pkg:npm/nocodb","source":"ghsa"}],"references":[{"url":"https://github.com/nocodb/nocodb/security/advisories/GHSA-8m7c-hf24-5g47","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47386","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nocodb/nocodb","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nocodb/nocodb/releases/tag/2026.05.1","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-24T19:17:37.476Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47386","url":"https://www.cve.org/CVERecord?id=CVE-2026-47386","licence":"CVE Terms of Use","modified":"2026-06-24T19:17:53.755Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8m7c-hf24-5g47","url":"https://github.com/advisories/GHSA-8m7c-hf24-5g47","licence":"CC-BY-4.0","modified":"2026-07-20T21:30:33.424Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47386","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47386","licence":"Public domain","modified":"2026-06-25T14:21:00.260Z"}],"updatedAt":"2026-11-25T22:59:25.544Z","epss":{"score":0.00197,"percentile":0.0996,"date":"2026-12-01T12:00:22.000Z"}}