CVE-2021-32702 Reflected XSS from the callback handler's error query parameter

High 8.0 Published Updated

Attackers can execute arbitrary JavaScript via reflected XSS in the callback error parameter, affecting Next.js applications using the Auth0 SDK.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-32702?

CVE-2021-32702 is a high-severity cross-site scripting vulnerability in nextjs-auth0, published on 25 Jun 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

The Auth0 Next.js SDK is a library for implementing user authentication in Next.js applications. Versions before and including `1.4.1` are vulnerable to reflected XSS. An attacker can execute arbitrary code by providing an XSS payload in the `error` query parameter which is then processed by the callback handler as an error message. You are affected by this vulnerability if you are using `@auth0/nextjs-auth0` version `1.4.1` or lower **unless** you are using custom error handling that does not return the error message in an HTML response. Upgrade to version `1.4.1` to resolve. The fix adds basic HTML escaping to the error message and it should not impact your users.

Weakness: CWE-79

Which versions are affected by CVE-2021-32702?

2 open source packages ship an affected version, including @auth0/nextjs-auth0. It affects 1 product.

PackageAffectedFixed in
@auth0/nextjs-auth0 npmAll versions1.4.2
@auth0/nextjs-auth0 npmAll versions1.4.2

Products include Auth0 Nextjs-Auth0.

How do I fix CVE-2021-32702?

Upgrade @auth0/nextjs-auth0 to 1.4.2 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2021-32702 being exploited?

There is no known exploitation of CVE-2021-32702 in the wild and no public exploit code.

Sources

Also known as GHSA-954c-jjx6-cxv7.

Is CVE-2021-32702 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free