CVE-2022-31093 Details
Description
NextAuth.js is a complete open source authentication solution for Next.js applications. In affected versions an attacker can send a request to an app using NextAuth.js with an invalid `callbackUrl` query parameter, which internally is converted to a `URL` object. The URL instantiation would fail due to a malformed URL being passed into the constructor, causing it to throw an unhandled error which led to the **API route handler timing out and logging in to fail**. This has been remedied in versions 3.29.5 and 4.5.0. If for some reason you cannot upgrade, the workaround requires you to rely on Advanced Initialization. Please see the documentation for more.
A vulnerability exists in NextAuth.js, an authentication solution for Next.js applications, in versions prior to 3.29.5 and 4.5.0. The issue arises when an attacker sends a request with an invalid 'callbackUrl' query parameter. This malformed URL fails during the URL object creation, leading to an unhandled error. Consequently, the API route handler times out, causing the login process to fail. This vulnerability has been patched in NextAuth.js versions 3.29.5 and 4.5.0.
Users can upgrade to NextAuth.js versions 3.29.5 or 4.5.0 to address this vulnerability. If an upgrade is not possible, the vulnerability can be mitigated by using 'Advanced Initialization' to validate the 'callbackUrl' before it is processed by NextAuth.js.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 23, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/nextauthjs/next-auth/commit/25517b73153332d948114bacdff3b5908de91d85 | CVE | PatchThird Party Advisory |
| https://github.com/nextauthjs/next-auth/commit/e498483b23273d1bfc81be68339607f88d411bd6 | CVE | PatchThird Party Advisory |
| https://github.com/nextauthjs/next-auth/security/advisories/GHSA-g5fm-jp9v-2432 | CVE | MitigationThird Party Advisory |
| https://next-auth.js.org/configuration/initialization#advanced-initialization | CVE | Vendor Advisory |
| https://github.com/nextauthjs/next-auth/commit/25517b73153332d948114bacdff3b5908de91d85 | [email protected] | PatchThird Party Advisory |
| https://github.com/nextauthjs/next-auth/commit/e498483b23273d1bfc81be68339607f88d411bd6 | [email protected] | PatchThird Party Advisory |
| https://github.com/nextauthjs/next-auth/security/advisories/GHSA-g5fm-jp9v-2432 | [email protected] | MitigationThird Party Advisory |
| https://next-auth.js.org/configuration/initialization#advanced-initialization | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-754 | Improper Check for Unusual or Exceptional Conditions | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| nextauth.js next-auth | >= 3.0.0, < 3.29.5 >= 4.0.0, < 4.5.0 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 21, 2024 | CVE Modified | CVE |
| May 14, 2024 | CVE Modified | [email protected] |
| Jul 7, 2022 | Initial Analysis | [email protected] |