Missing proper state, nonce and PKCE checks for OAuth authentication in next-auth
Published Mar 9, 2023
8.8
HIGHCVSS 3.1
EPSS 0.54%
Description
NextAuth.js is an open source authentication solution for Next.js applications. `next-auth` applications using OAuth provider versions before `v4.20.1` have been found to be subject to an authentication vulnerability. A bad actor who can read traffic on the victim's network or who is able to social engineer the victim to click a manipulated login link could intercept and tamper with the authorization URL to **log in as the victim**, bypassing the CSRF protection. This is due to a partial failure during a compromised OAuth session where a session code is erroneously generated. This issue has been addressed in version 4.20.1. Users are advised to upgrade. Users unable to upgrade may using Advanced Initialization, manually check the callback request for state, pkce, and nonce against the provider configuration to prevent this issue. See the linked GHSA for details.
Affected products
-
Affected
- < 4.20.1
Default status is the baseline for the product. Each version can override it (patched versions can be marked unaffected).
| Vendor | Product | Default status | Versions |
|---|---|---|---|
| Nextauthjs | Next-Auth | unknown | Affected
|
- < 4.20.1
No data.
No Red Hat product state for this CVE.
next-auth
npm
Introduced 0 Fixed 4.20.1
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| npm | next-auth | 0 | 4.20.1 |
Remediation
No remediation recorded yet.
References (11)
- https://authjs.dev/reference/core/providers#checks x_refsource_MISCProduct
- https://danielfett.de/2020/05/16/pkce-vs-nonce-equivalent-or-not/ x_refsource_MISCNot Applicable
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2023-0931 Advisory
- https://github.com/advisories/GHSA-7r7x-4c4q-c4qf Advisory
- https://github.com/nextauthjs/next-auth/compare/next-auth@4.20.0...next-auth@4.20.1#diff-cf9257195d0cb6a835ae4ff1fc73fe2cac0bab847efb0832c1f551209a972b47R55
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-7r7x-4c4q-c4qf x_refsource_CONFIRMExploitVendor Advisory
- https://next-auth.js.org/configuration/initialization#advanced-initialization x_refsource_MISCProduct
- https://next-auth.js.org/configuration/providers/oauth x_refsource_MISCProduct
- https://nvd.nist.gov/vuln/detail/CVE-2023-27490
- https://security.netapp.com/advisory/ntap-20230420-0006/
- https://www.rfc-editor.org/rfc/rfc6749#section-10.12 x_refsource_MISCNot Applicable
| Link | Providers | Tags |
|---|---|---|
| https://authjs.dev/reference/core/providers#checks | x_refsource_MISCProduct | |
| https://danielfett.de/2020/05/16/pkce-vs-nonce-equivalent-or-not/ | x_refsource_MISCNot Applicable | |
| https://euvd.enisa.europa.eu/vulnerability/EUVD-2023-0931 | Advisory | |
| https://github.com/advisories/GHSA-7r7x-4c4q-c4qf | Advisory | |
| https://github.com/nextauthjs/next-auth/compare/next-auth@4.20.0...next-auth@4.20.1#diff-cf9257195d0cb6a835ae4ff1fc73fe2cac0bab847efb0832c1f551209a972b47R55 | ||
| https://github.com/nextauthjs/next-auth/security/advisories/GHSA-7r7x-4c4q-c4qf | x_refsource_CONFIRMExploitVendor Advisory | |
| https://next-auth.js.org/configuration/initialization#advanced-initialization | x_refsource_MISCProduct | |
| https://next-auth.js.org/configuration/providers/oauth | x_refsource_MISCProduct | |
| https://nvd.nist.gov/vuln/detail/CVE-2023-27490 | ||
| https://security.netapp.com/advisory/ntap-20230420-0006/ | ||
| https://www.rfc-editor.org/rfc/rfc6749#section-10.12 | x_refsource_MISCNot Applicable |
Change history (0)
No recorded changes yet.
CVE.org / MITRE
CISA Vulnrichment
Red Hat
No data
GitHub