Next AuthApplication · Nextauth.js

CVE-2022-29214

MEDIUM · 6.1 CVSS v3.1 Published 2022-05-21
Fix available
A fix is available. Upgrade to 3.29.3 / 4.3.3 or later.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
NextAuth.js (next-auth) is am open source authentication solution for Next.js applications. Prior to versions 3.29.3 and 4.3.3, an open redirect vulnerability is present when the developer is implementing an OAuth 1 provider. Versions 3.29.3 and 4.3.3 contain a patch for this issue. The maintainers recommend adding a certain configuration to one's `callbacks` option as a workaround for those unable to upgrade.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

NextAuth.js versions prior to 3.29.3 and 4.3.3 contain an open redirect vulnerability when implementing an OAuth 1 provider. The vulnerability allows attackers to craft malicious URLs that can redirect authenticated users to attacker-controlled sites due to insufficient validation of redirect parameters in the OAuth 1 authentication flow.

MitigationUpgrade to NextAuth.js version 3.29.3 or 4.3.3, or implement proper redirect URL validation within the callbacks configuration option to verify the destination URL before allowing redirection.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Next AuthApplication
Affected:< 3.29.3>= 4.0.0, < 4.3.3

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed NextAuth.js version
    Run 'npm list next-auth' or 'npm list @next-auth/core' in your project directory to see the installed version. Alternatively, check your package.json file for the next-auth or @next-auth/core dependency version.
    Affected if The installed version is below 3.29.3 or is 4.0.0 through 4.3.2 (inclusive).
  2. Identify OAuth 1 provider configuration
    Examine your NextAuth.js configuration file (typically in pages/api/auth/[...nextauth].js, pages/api/auth/[...nextauth].ts, or app/api/auth/[...nextauth]/route.js/ts) and look for any provider objects that include 'requestTokenURL', 'accessTokenURL', and 'authorizationURL' properties, which indicate OAuth 1.0 usage.
    Affected if An OAuth 1.0 provider is configured with the three OAuth 1 specific URLs mentioned above.
  3. Inspect redirect callback validation
    Look at the 'callbacks' configuration in your NextAuth.js options for a 'redirect' callback that validates the URL parameter before allowing redirection. Check if it contains logic to verify the destination URL (e.g., checking if the URL starts with a trusted domain).
    Affected if No 'redirect' callback is defined, or the existing redirect callback does not validate that the url parameter points to a trusted destination.

You are affected if your NextAuth.js version is in the vulnerable range AND you use an OAuth 1 provider AND you lack proper URL validation in a redirect callback.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 3.29.3 / 4.3.3 or later
Fixed in 3.29.34.3.3
Interim mitigation

Upgrade to NextAuth.js version 3.29.3 or 4.3.3, or implement proper redirect URL validation within the callbacks configuration option to verify the destination URL before allowing redirection.

Recommended fix High confidence

NextAuth.js v3.29.3 or v4.3.3 (depending on your major version)

  1. If using NextAuth.js v3.x, upgrade to version 3.29.3 or later by running: npm install next-auth@^3.29.3
  2. If using NextAuth.js v4.x, upgrade to version 4.3.3 or later by running: npm install next-auth@^4.3.3
  3. After upgrading, verify your OAuth 1 provider configuration works correctly
  4. Alternatively, if unable to upgrade, add a redirect URL validation callback: callbacks: { signin: async (context) => { if (context.proxyUrl && !context.proxyUrl.startsWith('https://your-domain.com/')) { return false; } return true; } }
Caveat v4.x may have breaking changes from v3.x; review the v4 migration guide before upgrading if moving between major versions

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Next Auth Scoped from the published advisory
  • Consultation2.0 h
  • Implementation2.0 h
  • Testing2.0 h
  • Review / QA1.0 h
7.0 hours of engineering $1,240
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,984.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-29214 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-29214 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data