Information Exposure Affecting next-auth package, versions <3.29.9 >=4.0.0 <4.10.2


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.05% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-NEXTAUTH-2965597
  • published 2 Aug 2022
  • disclosed 2 Aug 2022
  • credit ShuPink

How to fix?

Upgrade next-auth to version 3.29.9, 4.10.2 or higher.

Overview

next-auth is an Authentication for Next.js

Affected versions of this package are vulnerable to Information Exposure where it is possible to reveal sensitive information such as an identity provider's secret in logs.

Note: This vulnerability can be worked around by configuring the logger manually to remove the provider secret.

import log from "your-logging-service"
export const authOptions: NextAuthOptions = {
  debug: process.env.NODE_ENV !== "production",
  logger: {
    error: (code, metadata) => {
      if (!(metadata instanceof Error) &&  metadata.provider) {
        // redact the provider secret here
        delete metadata.provider
        log.error(code, metadata)
      } else {
        log.error(code, metadata)
      }
    }
  },
}

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
3.3 low
  • Attack Vector (AV)
    Local
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    Low
  • Integrity (I)
    None
  • Availability (A)
    None
Expand this section

NVD

3.3 low