CVE-2021-21310
JavaScript vulnerability analysis and mitigation

Overview

NextAuth.js (next-auth) is an open source authentication solution for Next.js applications that contained a critical security vulnerability (CVE-2021-21310) in versions prior to 3.3.0. The vulnerability was discovered on February 8, 2021 and affected implementations using the Prisma database adapter with the Email provider (GitHub Advisory).

Technical details

The vulnerability existed in the Prisma database adapter's verification function where it checked the verification token but failed to verify the identifier (email address) associated with the token. This implementation flaw made it possible for an attacker to use a valid token assigned to one user to sign in as another user when using the Prisma adapter with the Email provider (GitHub Advisory).

Impact

The vulnerability allowed attackers to potentially impersonate other users by using a valid token assigned to one user to authenticate as another user. This only affected implementations using both the Prisma database adapter and the Email provider. Implementations using the default database adapter (TypeORM), those not using the Email provider, or those not using a database were not impacted (GitHub Advisory).

Exploitability

The vulnerability was rated as Critical severity. It required an attacker to have access to a valid verification token from one user account to potentially gain unauthorized access to another user's account (GitHub Advisory).

Mitigation and workarounds

The vulnerability was patched in version 3.3.0 of next-auth. For users unable to upgrade immediately, the recommended workaround was to disable the Email provider. The fix involved properly validating both the token and the associated email identifier in the verification process (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2021-43309HIGH7.5
  • JavaScript logoJavaScript
  • uri-template-lite
NoYesAug 24, 2022
CVE-2022-24375HIGH7.5
  • JavaScript logoJavaScript
  • node-opcua
NoYesAug 24, 2022
CVE-2022-25231HIGH7.5
  • JavaScript logoJavaScript
  • node-opcua
NoYesAug 23, 2022
CVE-2022-21208HIGH7.5
  • JavaScript logoJavaScript
  • node-opcua
NoYesAug 23, 2022
CVE-2022-2932MEDIUM6.1
  • JavaScript logoJavaScript
  • mobiledoc-kit
NoYesAug 22, 2022

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management