Read the docs
TI-2022-13171 Aliases CVE-2022-31127GHSA-pgjx-7f9g-9463

Improper handling of email input in next-auth

Priority MEDIUM 64CWE-79Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Cross-site scripting
Confidentiality · integrity · availability
Low · Low · Low
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.

Summary

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.01132 66th percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed next-auth (nextauthjs): 3.29.8, 4.9.0next-auth (npm): 3.29.8, 4.9.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
nextauthjsnext-authbefore 3.29.8; 4.0.0 to before 4.9.03.29.8, 4.9.0Patch availableCNA
—next-auth (npm)before 3.29.83.29.8Patch availableGHSA-pgjx-7f9g-9463
—next-auth (npm)4.0.0 to before 4.9.04.9.0Patch availableGHSA-pgjx-7f9g-9463
  • next-auth Vendornextauthjs Affected before 3.29.8; 4.0.0 to before 4.9.0 Fixed in 3.29.8, 4.9.0 Patch available CNA
  • next-auth (npm) Vendor— Affected before 3.29.8 Fixed in 3.29.8 Patch available GHSA-pgjx-7f9g-9463
  • next-auth (npm) Vendor— Affected 4.0.0 to before 4.9.0 Fixed in 4.9.0 Patch available GHSA-pgjx-7f9g-9463

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:*before 3.29.8; 4.0.0 to before 4.9.0Vulnerablenextauthjs
  • cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* Versions before 3.29.8; 4.0.0 to before 4.9.0 Vulnerable ·nextauthjs

Remediation

  • Fix · CNA next-auth (nextauthjs) Fixed in 3.29.8, 4.9.0
  • Fix · GHSA-pgjx-7f9g-9463 next-auth (npm) Fixed in 3.29.8 Advisory →
  • Fix · GHSA-pgjx-7f9g-9463 next-auth (npm) Fixed in 4.9.0 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-31127
  2. 2026-10-03 Alias added: GHSA-pgjx-7f9g-9463

References

  • TI-2022-16351 Verification requests (magic link) sent to unwanted emails CVSS 3.1CRITICAL 9.1
  • TI-2022-13137 Improper Handling of `callbackUrl` parameter in next-auth CVSS 3.1HIGH 7.5
  • TI-2023-12218 Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth CVSS 3.1HIGH 8.8
  • TI-2022-18639 NextAuth.js Upstash Adapter missing token verification CVSS 3.1HIGH 8.1
  • TI-2023-26172 next-auth vulnerable to possible user mocking that bypasses basic authentication CVSS 3.1MEDIUM 5.3
  • TI-2021-04410 Token verification bug in next-auth CVSS 3.1MEDIUM 6.1
See all 8 →

Sources