CVE-2022-21721 DOS Vulnerability in next.js

Medium 5.9 Published Updated

Attackers can cause denial of service in Next.js applications using built-in i18n support via custom servers, requiring an upgrade to mitigate.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-21721?

CVE-2022-21721 is a medium-severity denial of service vulnerability in Vercel Next.js, published on 28 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Next.js is a React framework. Starting with version 12.0.0 and prior to version 12.0.9, vulnerable code could allow a bad actor to trigger a denial of service attack for anyone using i18n functionality. In order to be affected by this CVE, one must use next start or a custom server and the built-in i18n support. Deployments on Vercel, along with similar environments where invalid requests are filtered before reaching Next.js, are not affected. A patch has been released, `[email protected]`, that mitigates this issue. As a workaround, one may ensure `/${locale}/_next/` is blocked from reaching the Next.js instance until it becomes feasible to upgrade.

Which versions are affected by CVE-2022-21721?

2 open source packages ship an affected version, including next. It affects 1 product.

PackageAffectedFixed in
next npmFrom 12.0.012.0.9
next npmFrom 12.0.012.0.9

Products include Vercel Next.js.

How do I fix CVE-2022-21721?

Upgrade next to 12.0.9 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2022-21721 being exploited?

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

All Vercel Next.js vulnerabilities

Sources

Also known as GHSA-wr66-vrwm-5g5x.

Is CVE-2022-21721 in your software?

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

Check your SBOMs for free