Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2023-27490
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 16:31 UTC · Revision 1
Source evidence
Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth
core-osv · Original sourcePublished 9 Mar 2023, 20:37 UTC
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.
osv:CVE-2023-27490
Complete source record
{
"id": "8eb67733973e2a07b4af5503befe248f99fc4f2bd8a1242491c0b05842895e00",
"url": "https://osv.dev/vulnerability/CVE-2023-27490",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth",
"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.",
"evidence": "osv:CVE-2023-27490",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2023-27490",
"aliases": [
"CVE-2023-27490",
"GHSA-7r7x-4c4q-c4qf"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/nextauthjs/next-auth",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "50b117dfbbd8392e3c19a5e882a83a7a455d2598"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "4.20.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"cpe": "cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "4.20.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"next-auth@4.20.0",
"next-auth@4.19.2",
"next-auth@4.19.1",
"next-auth@4.19.0",
"next-auth@4.18.10",
"next-auth@4.18.9",
"next-auth@4.18.8",
"next-auth@v4.18.7",
"@auth/sveltekit@v0.1.1",
"@auth/core@v0.1.1",
"@auth/sveltekit@v0.1.0",
"@auth/core@v0.1.0",
"next-auth@v4.18.6",
"next-auth@v4.18.5",
"next-auth@v4.18.4",
"next-auth@v4.18.3",
"next-auth@v4.18.2",
"next-auth@v4.18.1",
"next-auth@v4.18.0",
"@next-auth/pouchdb-adapter@v.0.1.5",
"@next-auth/firebase-adapter@v1.0.3",
"next-auth@v4.17.0",
"@next-auth/supabase-adapter@v0.2.0",
"next-auth@v4.16.4",
"next-auth@v4.16.3",
"next-auth@v4.16.2",
"next-auth@v4.16.1",
"next-auth@v4.16.0",
"next-auth@v.4.15.2",
"next-auth@v4.15.1",
"@next-auth/xata-adapter@v0.2.0",
"next-auth@v4.15.0",
"next-auth@v4.14.0",
"next-auth@v4.13.0",
"@next-auth/upstash-redis-adapter@v3.0.3",
"@next-auth/typeorm-legacy-adapter@v2.0.1",
"@next-auth/sequelize-adapter@v1.0.6",
"@next-auth/prisma-adapter@v1.0.5",
"@next-auth/neo4j-adapter@v1.0.5",
"@next-auth/mongodb-adapter@v1.1.1",
"@next-auth/mikro-orm-adapter@v3.0.1",
"@next-auth/firebase-adapter@v1.0.2",
"@next-auth/dynamodb-adapter@v1.0.5",
"next-auth@v4.12.2",
"next-auth@v4.12.1",
"next-auth@v4.12.0",
"@next-auth/upstash-redis-adapter@v3.0.2",
"next-auth@v4.11.0",
"@next-auth/mongodb-adapter@v1.1.0",
"@next-auth/mikro-orm-adapter@v3.0.0",
"next-auth@v4.10.3",
"next-auth@v4.10.2",
"@next-auth/upstash-redis-adapter@v3.0.1",
"@next-auth/prisma-adapter@v1.0.4",
"@next-auth/prisma-adapter@1.0.4",
"@next-auth/pouchdb-adapter@v0.1.4",
"@next-auth/neo4j-adapter@v1.0.4",
"@next-auth/mongodb-adapter@v1.0.4",
"@next-auth/firebase-adapter@v1.0.1",
"@next-auth/fauna-adapter@v1.0.4",
"@next-auth/dynamodb-adapter@v1.0.4",
"@next-auth/dgraph-adapter@v1.0.4",
"next-auth@v4.10.1",
"next-auth@v4.10.0",
"@next-auth/typeorm-legacy-adapter@v2.0.0",
"@next-auth/sequelize-adapter@v1.0.5",
"@next-auth/firebase-adapter@v1.0.0",
"next-auth@v4.9.0",
"next-auth@v4.8.0",
"next-auth@v4.6.1",
"next-auth@v4.5.0",
"next-auth@v4.3.4",
"next-auth@v4.3.3",
"next-auth@v4.3.1",
"next-auth@v4.3.0",
"@next-auth/typeorm-legacy-adapter@v1.0.2",
"@next-auth/prisma-adapter@v1.0.2",
"@next-auth/mongodb-adapter@v1.0.2",
"@next-auth/mikro-orm-adapter@v2.0.0",
"v3.29.0",
"v4.2.1",
"v4.2.0",
"v4.1.2",
"v4.1.1",
"v4.1.0",
"v4.0.6",
"v4.0.5",
"v4.0.4",
"v4.0.3",
"v4.0.2",
"v4.0.1",
"v3.28.0",
"v3.27.3",
"v3.27.2",
"v3.27.1",
"v3.27.0",
"v3.26.1",
"v3.26.0",
"v3.25.0",
"v3.24.1",
"v3.24.0",
"v3.23.3",
"v3.23.2",
"v3.23.1",
"v3.23.0",
"v3.22.0",
"v3.21.1",
"v3.21.0",
"v3.20.1",
"v3.20.0",
"v3.19.8",
"v3.19.7",
"v3.19.6",
"v3.19.5",
"v3.19.4",
"v3.19.3",
"v3.19.2",
"v3.19.1",
"v3.19.0",
"v3.18.2",
"v3.18.1",
"v3.18.0",
"v3.17.2",
"v3.17.1",
"v3.17.0",
"v3.16.1",
"v3.16.0",
"v3.15.13",
"v3.15.12",
"v3.15.11",
"v3.15.10",
"v3.15.9",
"v3.15.8",
"v3.15.7",
"v3.15.6",
"v3.15.5",
"v3.15.4",
"v3.15.3",
"v3.15.2",
"v3.15.1",
"v3.15.0",
"v3.14.8",
"v3.14.7",
"v3.14.6",
"v3.14.5",
"v3.14.4",
"v3.14.3",
"v3.14.2",
"v3.14.1",
"v3.14.0",
"v3.13.3",
"v3.13.2",
"v3.13.1",
"v3.13.0",
"v3.12.0",
"v3.11.2",
"v3.11.1",
"v3.11.0",
"v3.10.1",
"v3.10.0",
"v3.9.0",
"v3.8.0",
"v3.7.1",
"v3.7.0",
"v3.6.1",
"v3.6.0",
"v3.5.1",
"v3.5.0",
"v3.4.2",
"v3.4.1",
"v3.4.0",
"v3.3.1",
"v3.3.0",
"v3.2.1",
"v3.2.0",
"v3.1.0",
"v3.0.1",
"v3.0.0",
"v2.2.0",
"v2.1.0",
"v2.0.1",
"v2.0",
"v1.13.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-27490.json"
}
}
],
"modified": "2026-10-28T02:30:37.642195580Z",
"provider": "osv",
"references": [
"https://authjs.dev/reference/core/providers#checks",
"https://danielfett.de/2020/05/16/pkce-vs-nonce-equivalent-or-not/",
"https://next-auth.js.org/configuration/initialization#advanced-initialization",
"https://next-auth.js.org/configuration/providers/oauth",
"https://www.rfc-editor.org/rfc/rfc6749#section-10.12",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/27xxx/CVE-2023-27490.json",
"https://github.com/nextauthjs/next-auth/security/advisories/GHSA-7r7x-4c4q-c4qf",
"https://nvd.nist.gov/vuln/detail/CVE-2023-27490",
"https://security.netapp.com/advisory/ntap-20230420-0006/"
],
"provider_metadata": {
"cwe_ids": [
"CWE-352",
"CWE-384"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/27xxx/CVE-2023-27490.json"
}
},
"related_cves": [
{
"value": "CVE-2023-27490",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504696,
"published_at": "2023-03-09T20:37:11.407+00:00"
}