# CVE-2023-27490: Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth

- Severity: High 8.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.66%, higher than 52% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-03-09T20:37:11.407Z
- Modified: 2026-09-10T03:49:52.759Z
- Also known as: GHSA-7r7x-4c4q-c4qf
- Weaknesses: CWE-352, CWE-384
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- nextauthjs next-auth: < 4.20.1
- next-auth (npm): before 4.20.1
- nextauth.js next-auth: before 4.20.1

## Every score

- GitHub_M: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/nextauthjs/next-auth/security/advisories/GHSA-7r7x-4c4q-c4qf> (exploit, vendor-advisory, web)
- <https://authjs.dev/reference/core/providers#checks> (product, web)
- <https://danielfett.de/2020/05/16/pkce-vs-nonce-equivalent-or-not/> (not-applicable)
- <https://next-auth.js.org/configuration/initialization#advanced-initialization> (product, web)
- <https://next-auth.js.org/configuration/providers/oauth> (product, web)
- <https://www.rfc-editor.org/rfc/rfc6749#section-10.12> (not-applicable, web)
- <https://security.netapp.com/advisory/ntap-20230420-0006/>
- <https://nvd.nist.gov/vuln/detail/CVE-2023-27490> (advisory)
- <https://danielfett.de/2020/05/16/pkce-vs-nonce-equivalent-or-not> (web)
- <https://github.com/nextauthjs/next-auth> (package)
- <https://github.com/nextauthjs/next-auth/compare/next-auth@4.20.0...next-auth@4.20.1#diff-cf9257195d0cb6a835ae4ff1fc73fe2cac0bab847efb0832c1f551209a972b47R55> (web)
- <https://security.netapp.com/advisory/ntap-20230420-0006> (web)

## Sources

- CVE List: [CVE-2023-27490](https://www.cve.org/CVERecord?id=CVE-2023-27490), CVE Terms of Use, modified 2025-02-25
- GitHub Advisory Database: [GHSA-7r7x-4c4q-c4qf](https://github.com/advisories/GHSA-7r7x-4c4q-c4qf), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2023-27490](https://nvd.nist.gov/vuln/detail/CVE-2023-27490), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-27490 · Whole record: https://cve.day/CVE-2023-27490.json · Rebuilt by cve.day 2026-11-25T22:58:22.352Z
