CVE-2022-31093
HIGH 7.5CVSS 3.1Improper Handling of `callbackUrl` parameter in next-auth
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.
- Published
- 27 Jun 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-754
- Also known as
- GHSA-g5fm-jp9v-2432
- Sources
- NVDJSONOSV GHSA-g5fm-jp9v-2432JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | nextauth.js | next-authcpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* |
>= 3.0.0, < 3.29.5 | 3.29.5 |
| NVD | nextauth.js | next-authcpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* |
>= 4.0.0, < 4.5.0 | 4.5.0 |
| OSV | npm | next-auth | < 3.29.5 | 3.29.5 |
| OSV | npm | next-auth | >= 4.0.0, < 4.5.0 | 4.5.0 |
References
- https://github.com/nextauthjs/next-auth/commit/25517b73153332d948114bacdff3b5908de91d85 · Patch, Third Party Advisory, WEB
- https://github.com/nextauthjs/next-auth/commit/e498483b23273d1bfc81be68339607f88d411bd6 · Patch, Third Party Advisory, WEB
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-g5fm-jp9v-2432 · Mitigation, Third Party Advisory, WEB
- https://next-auth.js.org/configuration/initialization#advanced-initialization · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-31093 · ADVISORY
- https://github.com/nextauthjs/next-auth · PACKAGE
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 27 Jun 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 21 Jun 2022)