CVE-2023-27490 json
Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth
published 2023-03-09 3 y ago modified 2026-09-10 1 mo ago also GHSA-7r7x-4c4q-c4qf , EUVD-2023-0931
- cvss
- 8.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 45%
- public exploits
- 0
- none known
Summary
NextAuth.js is an open source authentication solution for Next.js applications. `next-auth` applications using OAuth provider versions before `v4.20.1` have been found to be subject to an authentication vulnerability. A bad actor who can read traffic on the victim's network or who is able to social engineer the victim to click a manipulated login link could intercept and tamper with the authorization URL to **log in as the victim**, bypassing the CSRF protection. This is due to a partial failure during a compromised OAuth session where a session code is erroneously generated. This issue has been addressed in version 4.20.1. Users are advised to upgrade. Users unable to upgrade may using Advanced Initialization, manually check the callback request for state, pkce, and nonce against the provider configuration to prevent this issue. See the linked GHSA for details.
Patch / fix
- npm next-auth 4.20.1
- nextauth.js next-auth 4.20.1
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 20 mo ago
Exploit prediction
0.54% chance of exploitation in the next 30 days, higher than 45% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/nextauthjs/next-auth/security/advisories/GHSA-7r7x-4c4q-c4qf referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | next-auth | <4.20.1 |
4.20.1 |
Affected products
- nextauthjs next-auth
Classification
References
-
github.com
/nextauthjs/next-auth/security/advisories/GHSA-7r7x-4c4q-c4qf
web, exploit, vendor-advisory
-
authjs.dev
/reference/core/providers#checks
web, product
-
danielfett.de
/2020/05/16/pkce-vs-nonce-equivalent-or-not/
not-applicable
-
next-auth.js.org
/configuration/initialization#advanced-initialization
web, product
-
next-auth.js.org
/configuration/providers/oauth
web, product
-
rfc-editor.org
/rfc/rfc6749#section-10.12
web, not-applicable
- security.netapp.com /advisory/ntap-20230420-0006/
-
nvd.nist.gov
/vuln/detail/CVE-2023-27490
advisory
-
danielfett.de
/2020/05/16/pkce-vs-nonce-equivalent-or-not
web
-
github.com
/nextauthjs/next-auth
package
-
github.com
/nextauthjs/next-auth/compare/next-auth@4.20.0...next-auth@4.20.1#diff-cf9257195d0cb6a835ae4ff1fc73fe2cac0bab8
web
-
security.netapp.com
/advisory/ntap-20230420-0006
web
Sources
- CVE List CVE-2023-27490
- GitHub Advisory GHSA-7r7x-4c4q-c4qf
- NVD CVE-2023-27490
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.