CVE-2022-35924
NextAuth.js Email Provider Comma Injection Vulnerability
Description
NextAuth.js is a complete open source authentication solution for Next.js applications. `next-auth` users who are using the `EmailProvider` either in versions before `4.10.3` or `3.29.10` are affected. If an attacker could forge a request that sent a comma-separated list of emails (eg.: `[email protected],[email protected]`) to the sign-in endpoint, NextAuth.js would send emails to both the attacker and the victim's e-mail addresses. The attacker could then login as a newly created user with the email being `[email protected],[email protected]`. This means that basic authorization like `email.endsWith("@victim.com")` in the `signIn` callback would fail to communicate a threat to the developer and would let the attacker bypass authorization, even with an `@attacker.com` address. This vulnerability has been patched in `v4.10.3` and `v3.29.10` by normalizing the email value that is sent to the sign-in endpoint before accessing it anywhere else. We also added a `normalizeIdentifier` callback on the `EmailProvider` configuration, where you can further tweak your requirements for what your system considers a valid e-mail address. (E.g.: strict RFC2821 compliance). Users are advised to upgrade. There are no known workarounds for this vulnerability. If for some reason you cannot upgrade, you can normalize the incoming request using Advanced Initialization.
INFO
Published Date :
Aug. 2, 2022, 6:15 p.m.
Last Modified :
Nov. 21, 2024, 7:11 a.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
5.2
Exploitability Score :
3.9
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2022-35924
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2022-35924
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2022-35924
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://en.wikipedia.org/wiki/Email_address#Local-part Added Reference https://github.com/nextauthjs/next-auth/commit/afb1fcdae3cc30445038ef588e491d139b916003 Added Reference https://github.com/nextauthjs/next-auth/security/advisories/GHSA-xv97-c62v-4587 Added Reference https://next-auth.js.org/configuration/callbacks#sign-in-callback Added Reference https://next-auth.js.org/configuration/initialization#advanced-initialization Added Reference https://next-auth.js.org/providers/email Added Reference https://next-auth.js.org/providers/email#normalizing-the-e-mail-address Added Reference https://nodemailer.com/message/addresses -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Aug. 10, 2022
Action Type Old Value New Value Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N Changed Reference Type https://en.wikipedia.org/wiki/Email_address#Local-part No Types Assigned https://en.wikipedia.org/wiki/Email_address#Local-part Third Party Advisory Changed Reference Type https://github.com/nextauthjs/next-auth/commit/afb1fcdae3cc30445038ef588e491d139b916003 No Types Assigned https://github.com/nextauthjs/next-auth/commit/afb1fcdae3cc30445038ef588e491d139b916003 Patch, Third Party Advisory Changed Reference Type https://github.com/nextauthjs/next-auth/security/advisories/GHSA-xv97-c62v-4587 No Types Assigned https://github.com/nextauthjs/next-auth/security/advisories/GHSA-xv97-c62v-4587 Mitigation, Third Party Advisory Changed Reference Type https://next-auth.js.org/configuration/callbacks#sign-in-callback No Types Assigned https://next-auth.js.org/configuration/callbacks#sign-in-callback Vendor Advisory Changed Reference Type https://next-auth.js.org/configuration/initialization#advanced-initialization No Types Assigned https://next-auth.js.org/configuration/initialization#advanced-initialization Vendor Advisory Changed Reference Type https://next-auth.js.org/providers/email No Types Assigned https://next-auth.js.org/providers/email Vendor Advisory Changed Reference Type https://next-auth.js.org/providers/email#normalizing-the-e-mail-address No Types Assigned https://next-auth.js.org/providers/email#normalizing-the-e-mail-address Vendor Advisory Changed Reference Type https://nodemailer.com/message/addresses No Types Assigned https://nodemailer.com/message/addresses Third Party Advisory Added CWE NIST CWE-863 Added CPE Configuration OR *cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.29.10 *cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* versions from (including) 4.0.0 up to (excluding) 4.10.3
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2022-35924
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2022-35924
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.27 }} 0.04%
score
0.68266
percentile