CVE-2022-31186
What it is
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.
At a glance
- Exploitability
- Can be exploited locally on the machine with a low-privilege account. Limited direct impact.
- Exploit odds
- 0.3% chance of exploitation in the next 30 days (EPSS).
- Fix
- A patch, advisory or fixed version is referenced. Upgrade or apply it.
Timeline
- PublishedDisclosed publicly on CVE.org and NVD
- Last updatedMost recent change to the record
Why it ranks here
- Exploited in the wild: no, CISA does not list it.
- Exploit odds: 0.3% in the next 30 days (EPSS).
- Severity: 3.3 LOW (CVSS).
- Fix: a patch or advisory is linked.
Details
- Published
- Last modified
- Exploit probability
- 0.3% · EPSS, next 30 days
- Weakness
- CWE-532 · Secrets in logs
- Record status
- Modified
Affected
- next-auth nextauth.js < 3.29.9
- next-auth nextauth.js < 4.10.2
Attack profile CVSS 3.1 · 3.3
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Raw vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Is it in your code?
Hand this to your coding agent. It searches your project for the affected products and checks versions. Nothing leaves your machine.
Read https://cve-list.com/agent/cve/CVE-2022-31186.md and follow it. Check whether this project is affected by CVE-2022-31186. Read only. Don't change anything and don't upload my code. Tell me yes, no or not sure, with the file as proof.
Fix and advisories
- 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
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