CVE-2022-31186 Details
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.
A vulnerability allowing information disclosure has been identified in NextAuth.js versions prior to 4.10.2 and 3.29.9. This issue arises during OAuth error handling, where an attacker with log access can retrieve sensitive information, such as an identity provider's secret, from the logs. This leaked information could be exploited to impersonate the client and request additional permissions. The vulnerability has been addressed in versions 4.10.2 and 3.29.9 by changing the log level for provider information and adding a warning about the debug option in production.
Users can upgrade to NextAuth.js version 4.10.2 or 3.29.9. If an upgrade is not possible, the 'logger' configuration option can be used to sanitize logs by redacting sensitive provider information.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 23, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/nextauthjs/next-auth/security/advisories/GHSA-p6mm-27gq-9v3p | CVE | Third Party Advisory |
| https://next-auth.js.org/configuration/options#logger | CVE | Vendor Advisory |
| https://next-auth.js.org/getting-started/upgrade-v4 | CVE | Vendor Advisory |
| https://next-auth.js.org/warnings#debug_enabled | CVE | Vendor Advisory |
| https://github.com/nextauthjs/next-auth/security/advisories/GHSA-p6mm-27gq-9v3p | [email protected] | Third Party Advisory |
| https://next-auth.js.org/configuration/options#logger | [email protected] | Vendor Advisory |
| https://next-auth.js.org/getting-started/upgrade-v4 | [email protected] | Vendor Advisory |
| https://next-auth.js.org/warnings#debug_enabled | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-532 | Insertion of Sensitive Information into Log File | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| next-auth nextauth.js | < 3.29.9 >= 4.0.0, < 4.10.2 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 21, 2024 | CVE Modified | CVE |
| May 14, 2024 | CVE Modified | [email protected] |
| Aug 9, 2022 | Initial Analysis | [email protected] |