CVE-2022-31093Nextauth.js Next-auth
High 7.5 No auth needed
Follow: this CVE · Nextauth.js · Nextauth.js Next-auth We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- 1.9% probability of exploitation in 30 days · percentile 80
- Auth required
- No
- Published
- Jun 27, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-754
- SSVC (CISA)
- Exploitation: none · Automatable: yes · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
What happens
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.
What to do
- Apply the vendor's security update for Next-auth.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | next-auth |
< 3.29.5 |
3.29.5 |
npm install next-auth@3.29.5 |
| npm | next-auth |
≥ 4.0.0 < 4.5.0 |
4.5.0 |
npm install next-auth@4.5.0 |
Per OSV / GitHub Advisories (GHSA-g5fm-jp9v-2432). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| nextauth.js | next-auth | ≥ 3.0.0 < 3.29.5 |
| nextauth.js | next-auth | ≥ 4.0.0 < 4.5.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Patch Third Party Advisory
- github.com Mitigation Third Party Advisory
- next-auth.js.org Vendor Advisory