Skip to content
Heist/ feed
Back to feed
Medium

NextAuth.js Upstash Adapter missing token verification

Type: advisorySources: OSV

`@next-auth/upstash-redis-adapter` is the Upstash Redis adapter for NextAuth.js, which provides authentication for Next.js. Applications that use `next-auth` Email Provider and `@next-auth/upstash-redis-adapter` before v3.0.2 are affected by this vulnerability. The Upstash Redis adapter implementation did not check for both the identifier (email) and the token, but only checking for the identifier when verifying the token in the email callback flow. An attacker who knows about the victim's email could easily sign in as the victim, given the attacker also knows about the verification token's expired duration. The vulnerability is patched in v3.0.2. A workaround is available. Using Advanced Initialization, developers can check the requests and compare the query's token and identifier before proceeding.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-39263
Confirmed fixed CVEs
Not specified
Updated in this feed
8 Nov 2026, 02:03 UTC · Revision 1

Source evidence

NextAuth.js Upstash Adapter missing token verification

core-osv · Original source

Published 28 Sept 2022, 21:05 UTC

`@next-auth/upstash-redis-adapter` is the Upstash Redis adapter for NextAuth.js, which provides authentication for Next.js. Applications that use `next-auth` Email Provider and `@next-auth/upstash-redis-adapter` before v3.0.2 are affected by this vulnerability. The Upstash Redis adapter implementation did not check for both the identifier (email) and the token, but only checking for the identifier when verifying the token in the email callback flow. An attacker who knows about the victim's email could easily sign in as the victim, given the attacker also knows about the verification token's expired duration. The vulnerability is patched in v3.0.2. A workaround is available. Using Advanced Initialization, developers can check the requests and compare the query's token and identifier before proceeding.

osv:CVE-2022-39263
Complete source record
{
  "id": "a6b1bc2d923ec3b1b3bb419705a02a9c8d780fb31519a8096cd9683a1bb61194",
  "url": "https://osv.dev/vulnerability/CVE-2022-39263",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "NextAuth.js Upstash Adapter missing token verification",
    "summary": "`@next-auth/upstash-redis-adapter` is the Upstash Redis adapter for NextAuth.js, which provides authentication for Next.js. Applications that use `next-auth` Email Provider and `@next-auth/upstash-redis-adapter` before v3.0.2 are affected by this vulnerability. The Upstash Redis adapter implementation did not check for both the identifier (email) and the token, but only checking for the identifier when verifying the token in the email callback flow. An attacker who knows about the victim's email could easily sign in as the victim, given the attacker also knows about the verification token's expired duration. The vulnerability is patched in v3.0.2. A workaround is available. Using Advanced Initialization, developers can check the requests and compare the query's token and identifier before proceeding.",
    "evidence": "osv:CVE-2022-39263",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-39263",
      "aliases": [
        "CVE-2022-39263",
        "GHSA-4rxr-27mm-mxq9"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/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": "2d8e910a19e8dbfe881d315946afec7c88889f0a"
                },
                {
                  "fixed": "d16e04848ee703cf797724194d4ad2907fe125a9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.0.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "d16e04848ee703cf797724194d4ad2907fe125a9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "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-2022-39263.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:52.872802023Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39263.json",
        "https://github.com/nextauthjs/next-auth/security/advisories/GHSA-4rxr-27mm-mxq9",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-39263",
        "https://github.com/nextauthjs/next-auth/commit/d16e04848ee703cf797724194d4ad2907fe125a9"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-287"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39263.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-39263",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 521605,
  "published_at": "2022-09-28T21:05:09+00:00"
}