Skip to content

CVE-2022-31093 Improper Handling of `callbackUrl` parameter in next-auth

HighCVSS 7.5 EPSS 1.8%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: partial

Description

NextAuth.js is a complete open source authentication solution for Next.js applications. In affected versions an attacker can send a request to an app using NextAuth.js with an invalid callbackUrl query parameter, which internally is converted to a URL object. The URL instantiation would fail due to a malformed URL being passed into the constructor, causing it to throw an unhandled error which led to the API route handler timing out and logging in to fail. This has been remedied in versions 3.29.5 and 4.5.0. If for some reason you cannot upgrade, the workaround requires you to rely on Advanced Initialization. Please see the documentation for more.

Upgrade path

3 packages: 2 fixed.

PackageAffectedFixed inStatus
nextauth.js next-auth >= 3.0.0, < 3.29.5; >= 4.0.0, < 4.5.0 3.29.5, 4.5.0 Fixed
npm next-auth(npm) < 3.29.5; >= 4.0.0, < 4.5.0 3.29.5, 4.5.0 Fixed
nextauthjs next-auth = < 3.29.5; = >= 4.0.0, < 4.5.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
npm next-auth(npm) < 3.29.5 3.29.5
npm next-auth(npm) >= 4.0.0, < 4.5.0 4.5.0
nextauthjs next-auth = < 3.29.5 No fix listed
nextauthjs next-auth = >= 4.0.0, < 4.5.0 No fix listed
nextauth.js next-auth >= 3.0.0, < 3.29.5 3.29.5
nextauth.js next-auth >= 4.0.0, < 4.5.0 4.5.0

References