CVE-2022-35924
JavaScript vulnerability analysis and mitigation

Overview

NextAuth.js authentication bypass vulnerability (CVE-2022-35924) was discovered on July 26, 2022, affecting users of the EmailProvider in versions before 4.10.3 and 3.29.10. The vulnerability allowed attackers to bypass authentication controls by manipulating email addresses in sign-in requests. NextAuth.js is an open-source authentication solution designed for Next.js applications (Security Online, GitHub Advisory).

Technical details

The vulnerability had a CVSS score of 9.1 (Critical). The issue occurred when an attacker could forge a request containing a comma-separated list of emails (e.g., attacker@attacker.com,victim@victim.com) to the sign-in endpoint. NextAuth.js would then send emails to both addresses, allowing the attacker to login as a newly created user with the combined email address. This bypassed basic authorization checks like email.endsWith('@victim.com') in the signIn callback, even with an @attacker.com address (GitHub Advisory).

Impact

The vulnerability allowed attackers to bypass authentication controls and gain unauthorized access to systems using NextAuth.js for email-based authentication. This could potentially lead to account takeover and unauthorized access to protected resources. The issue affected organizations using email-based authentication with NextAuth.js's EmailProvider (Security Online).

Mitigation and workarounds

The vulnerability was patched in versions v4.10.3 and v3.29.10 by normalizing the email value sent to the sign-in endpoint before processing it. The fix included adding a normalizeIdentifier callback on the EmailProvider configuration for customizing email address validation requirements. Users were advised to upgrade to the patched versions immediately. For those unable to upgrade, a workaround was provided using Advanced Initialization to normalize incoming requests (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-2025-59532HIGH8.6
  • JavaScriptJavaScript
  • @openai/codex
NoYesSep 22, 2025
CVE-2025-59430HIGH8.2
  • JavaScriptJavaScript
  • @meshconnect/web-link-sdk
NoYesSep 22, 2025
CVE-2025-59433MEDIUM5.3
  • JavaScriptJavaScript
  • @conventional-changelog/git-client
NoYesSep 22, 2025
CVE-2025-59526LOW2.7
  • JavaScriptJavaScript
  • mailgen
NoYesSep 22, 2025
GHSA-g38c-wxjf-xrh6HIGHN/A
  • JavaScriptJavaScript
  • git-commiters
NoYesSep 22, 2025

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