What’s Vulnerable › Vulnerabilities
CVE-2022-31186: Leakage of excessive information into log in next-auth
- Severity: low (CVSS 3.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.3% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-08-01 · updated 2026-06-17
- Weakness: CWE-532
Description
NextAuth.js is a complete open source authentication solution for Next.js applications. An information disclosure vulnerability in `next-auth` before `v4.10.2` and `v3.29.9` allows an attacker with log access privilege to obtain excessive information such as an identity provider's secret in the log (which is thrown during OAuth error handling) and use it to leverage further attacks on the system, like impersonating the client to ask for extensive permissions. This issue has been patched in `v4.10.2` and `v3.29.9` by moving the log for `provider` information to the debug level. In addition, we added a warning for having the `debug: true` option turned on in production. If for some reason you cannot upgrade, you can user the `logger` configuration option by sanitizing the logs.
Affected products
- Next-Auth Nextauth.Js: before 3.29.9; from 4.0.0 before 4.10.2 — fixed in 3.29.9, 4.10.2
How to fix
Upgrade to a fixed version: Next-Auth Nextauth.Js 3.29.9, 4.10.2. Check the vendor advisory for mitigations.
References
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-p6mm-27gq-9v3p
- https://next-auth.js.org/configuration/options#logger
- https://next-auth.js.org/getting-started/upgrade-v4
- https://next-auth.js.org/warnings#debug_enabled
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-p6mm-27gq-9v3p
- https://next-auth.js.org/configuration/options#logger
- https://next-auth.js.org/getting-started/upgrade-v4
- https://next-auth.js.org/warnings#debug_enabled
Get alerted when CVE-2022-31186 or the next vulnerability affects your stack