7.1
HIGH
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 :

July 14, 2022, 2:31 p.m.

Remotely Exploitable :

Yes !

Impact Score :

3.7

Exploitability Score :

2.8
Affected Products

The following products are affected by CVE-2022-31127 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Nextauth.js next-auth
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

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 [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
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
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.11 }} -0.00%

score

0.44967

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability