CVE-2021-43812: Auth0 nextjs-auth0 open redirect in login handler

CVE-2021-43812 · Severity: low · CVSS 3.1 · Published 2021-12-16

The Auth0 SDK for Next.js, which handles user logins for web applications, contains a security flaw that allows for open redirects. An attacker can trick users into visiting a legitimate-looking login link that, upon successful authentication, redirects them to a malicious external website. This can be used in phishing campaigns to steal user credentials or distribute malware by exploiting the user's trust in the original application.

Technologies: Auth0 Nextjs-Auth0, @auth0/nextjs-auth0 (npm). Vendors: Auth0, npm.

Quick answers

Is CVE-2021-43812 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-43812 being exploited in the wild.
How severe is CVE-2021-43812?
Low severity, with a CVSS score of 3.1, published 16 December 2021.
Which products and versions are affected?
Auth0 Nextjs-Auth0 <= 1.6.1; @auth0/nextjs-auth0 (npm) SEMVER:introduced=0,fixed=1.6.2.
Is there a fix for CVE-2021-43812?
Yes. @auth0/nextjs-auth0 (npm): upgrade to 1.6.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-43812 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2021-43812?
Check whether you run Auth0 Nextjs-Auth0 or @auth0/nextjs-auth0 (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @auth0/nextjs-auth0 (npm): upgrade to 1.6.2 or later
    npm install @auth0/nextjs-auth0@1.6.2

Technical details

An open redirect vulnerability (CWE-601) exists in @auth0/nextjs-auth0 versions prior to 1.6.2. The library fails to properly validate or filter the 'returnTo' parameter provided in the login URL, allowing an attacker to supply an arbitrary external URL. While the CVSS provided by the vendor suggests low privilege (PR:L) may be involved, open redirects typically involve unauthenticated users being redirected after a login flow. An attacker can craft a link that redirects a victim to a malicious site after they authenticate with the legitimate service. The issue was resolved in version 1.6.2 by enforcing that the redirect host matches the configured application host.

Affected products

  • Auth0 @auth0/nextjs-auth0 <= 1.6.1

Identifiers

  • CVE-2021-43812
  • GHSA-2mqv-4j3r-vjvp

Timeline

  • 2021-12-16: advisory: GitHub Security Advisory published
  • 2021-12-16: patched: Version 1.6.2 released to address the vulnerability

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.