CVE-2022-31127
NextAuth.js HTML Email Injection Vulnerability
Description
NextAuth.js is a complete open source authentication solution for Next.js applications. An attacker can pass a compromised input to the e-mail [signin endpoint](https://next-auth.js.org/getting-started/rest-api#post-apiauthsigninprovider) that contains some malicious HTML, tricking the e-mail server to send it to the user, so they can perform a phishing attack. Eg.: `[email protected], <a href="http://attacker.com">Before signing in, claim your money!</a>`. This was previously sent to `[email protected]`, and the content of the email containing a link to the attacker's site was rendered in the HTML. This has been remedied in the following releases, by simply not rendering that e-mail in the HTML, since it should be obvious to the receiver what e-mail they used: next-auth v3 users before version 3.29.8 are impacted. (We recommend upgrading to v4, as v3 is considered unmaintained. next-auth v4 users before version 4.9.0 are impacted. If for some reason you cannot upgrade, the workaround requires you to sanitize the `email` parameter that is passed to `sendVerificationRequest` and rendered in the HTML. If you haven't created a custom `sendVerificationRequest`, you only need to upgrade. Otherwise, make sure to either exclude `email` from the HTML body or efficiently sanitize it.
INFO
Published Date :
July 6, 2022, 6:15 p.m.
Last Modified :
Nov. 21, 2024, 7:03 a.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
3.7
Exploitability Score :
2.8
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-31127
.
URL | Resource |
---|---|
https://github.com/nextauthjs/next-auth/commit/ae834f1e08a4a9915665eecb9479c74c6b039c9c | Patch Third Party Advisory |
https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.9.0 | Release Notes Third Party Advisory |
https://github.com/nextauthjs/next-auth/security/advisories/GHSA-pgjx-7f9g-9463 | Exploit Third Party Advisory |
https://next-auth.js.org/getting-started/upgrade-v4 | Vendor Advisory |
https://next-auth.js.org/providers/email#customizing-emails | Vendor Advisory |
https://github.com/nextauthjs/next-auth/commit/ae834f1e08a4a9915665eecb9479c74c6b039c9c | Patch Third Party Advisory |
https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.9.0 | Release Notes Third Party Advisory |
https://github.com/nextauthjs/next-auth/security/advisories/GHSA-pgjx-7f9g-9463 | Exploit Third Party Advisory |
https://next-auth.js.org/getting-started/upgrade-v4 | Vendor Advisory |
https://next-auth.js.org/providers/email#customizing-emails | Vendor Advisory |
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-31127
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2022-31127
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://github.com/nextauthjs/next-auth/commit/ae834f1e08a4a9915665eecb9479c74c6b039c9c Added Reference https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.9.0 Added Reference https://github.com/nextauthjs/next-auth/security/advisories/GHSA-pgjx-7f9g-9463 Added Reference https://next-auth.js.org/getting-started/upgrade-v4 Added Reference https://next-auth.js.org/providers/email#customizing-emails -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Jul. 14, 2022
Action Type Old Value New Value Added CVSS V2 Metadata Victim must voluntarily interact with attack mechanism Added CVSS V2 NIST (AV:N/AC:M/Au:N/C:N/I:P/A:N) Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N Changed Reference Type https://github.com/nextauthjs/next-auth/commit/ae834f1e08a4a9915665eecb9479c74c6b039c9c No Types Assigned https://github.com/nextauthjs/next-auth/commit/ae834f1e08a4a9915665eecb9479c74c6b039c9c Patch, Third Party Advisory Changed Reference Type https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.9.0 No Types Assigned https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.9.0 Release Notes, Third Party Advisory Changed Reference Type https://github.com/nextauthjs/next-auth/security/advisories/GHSA-pgjx-7f9g-9463 No Types Assigned https://github.com/nextauthjs/next-auth/security/advisories/GHSA-pgjx-7f9g-9463 Exploit, Third Party Advisory Changed Reference Type https://next-auth.js.org/getting-started/upgrade-v4 No Types Assigned https://next-auth.js.org/getting-started/upgrade-v4 Vendor Advisory Changed Reference Type https://next-auth.js.org/providers/email#customizing-emails No Types Assigned https://next-auth.js.org/providers/email#customizing-emails Vendor Advisory Added CPE Configuration OR *cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.29.8 *cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* versions from (including) 4.0.0 up to (excluding) 4.9.0
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-31127
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-31127
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.17 }} 0.03%
score
0.54393
percentile