CVE-2022-24858
MEDIUM 6.1CVSS 3.1NextAuth.js default redirect callback vulnerable to open redirects
next-auth v3 users before version 3.29.2 are impacted. next-auth version 4 users before version 4.3.2 are also impacted. Upgrading to 3.29.2 or 4.3.2 will patch this vulnerability. If you are not able to upgrade for any reason, you can add a configuration to your callbacks option. If you already have a redirect callback, make sure that you match the incoming url origin against the baseUrl.
- Published
- 19 Apr 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-290CWE-601
- Also known as
- GHSA-f9wg-5f46-cjmw
- Sources
- NVDJSONOSV GHSA-f9wg-5f46-cjmwJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.8 | AV:N/AC:M/Au:N/C:P/I:P/A:N |
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.2 | 3.29.2 |
| NVD | nextauth.js | next-authcpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* |
>= 4.0.0, < 4.3.2 | 4.3.2 |
| OSV | npm | next-auth | < 3.29.2 | 3.29.2 |
| OSV | npm | next-auth | >= 4.0.0, < 4.3.2 | 4.3.2 |
References
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-f9wg-5f46-cjmw · Mitigation, Third Party Advisory, WEB
- https://next-auth.js.org/configuration/callbacks#redirect-callback · Vendor Advisory, WEB
- https://next-auth.js.org/getting-started/upgrade-v4 · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-24858 · ADVISORY
- https://github.com/nextauthjs/next-auth/commit/6e15bdcb2d93c1ad5ee3889f702607637e79db50 · WEB
- https://github.com/nextauthjs/next-auth · PACKAGE
- https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.3.2 · WEB
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 19 Apr 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 22 Apr 2022)