CVE-2022-21721: Denial of Service Vulnerability in next.js

next Updated 02 Oct 2025

Summary

28/01/2022
Yes i
Moderate
5.9

CVE-2022-21721: Denial of Service Vulnerability in next.js. Affects next versions >= 12.0.0, < 12.0.9. Fixed in 12.0.9. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Next.js is a popular open-source framework for building server-side rendered React applications. It provides a range of features and tools to simplify the development process, including built-in i18n support for internationalization. However, Next.js versions 12.0.0 and above are vulnerable to a denial of service attack when using the i18n functionality.

Vulnerability Detail

The vulnerability allows a malicious actor to trigger a denial of service attack on Next.js apps running version 12.0.0 or higher and using i18n functionality. This can impact anyone using Next.js with a custom server or using the 'next start' command. Deployments on Vercel or similar environments where invalid requests are filtered before reaching Next.js are not affected. The vulnerability has a CVSS score of 5.9, indicating a moderate severity level.

How To Fix

Latest published version: 16.4.2 as of 22 Oct 2026

npm install next@16.4.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

12.0.9

This is the first release that contains the fix.

npm install next@12.0.9

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading immediately is not feasible, a temporary workaround is to block requests to the '/${locale}/_next/' path from reaching the Next.js instance until the upgrade can be performed. This can be achieved through server configuration or middleware. However, it is important to note that this is not a permanent solution and upgrading is still necessary.

Conclusion

In conclusion, Next.js versions 12.0.0 and above are vulnerable to a denial of service attack when using the i18n functionality. It is crucial to upgrade to version 12.0.9 or higher to mitigate this vulnerability. Blocking requests to the '/${locale}/_next/' path can serve as a temporary workaround until the upgrade is completed. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for next →

Share this vulnerability

FAQ

Next.js versions 12.0.0 and above are affected by this vulnerability.

The vulnerability allows for a denial of service attack, potentially impacting the availability of Next.js apps using the i18n functionality.

No, deployments on Vercel or similar environments where invalid requests are filtered before reaching Next.js are not affected by this vulnerability.

The recommended solution is to upgrade to the latest version of Next.js (12.0.9 or higher) that includes a patch to mitigate the vulnerability.

Yes, a temporary workaround is to block requests to the '/${locale}/_next/' path from reaching the Next.js instance until the upgrade can be performed.

Related vulnerabilities

Recent vulnerabilities recorded for next.

How To Fix

Latest published version: 16.4.2 as of 22 Oct 2026

npm install next@16.4.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

12.0.9

This is the first release that contains the fix.

npm install next@12.0.9

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback