CVE-2021-37699: Open Redirect in Next.js

next Updated 02 Oct 2025

Summary

12/08/2021
Yes i
Moderate
6.9

CVE-2021-37699: Open Redirect in Next.js. Affects next versions >= 0.9.9, < 11.1.0. Fixed in 11.1.0. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Next.js is an open source website development framework designed to be used with the React library. It provides a robust and efficient way to build server-side rendered React applications. Next.js allows developers to create static pages, server-side rendered pages, and dynamic pages with ease. It is widely used in the industry for building modern web applications.

Vulnerability Detail

The vulnerability identified as CVE-2021-37699 affects Next.js versions between 10.0.5 and 10.2.0, as well as versions 11.0.0 and 11.0.1. When the pages/_error.js file is statically generated, specially encoded paths can be used to trigger an open redirect to an external site. Although this redirect does not directly harm users, it can be exploited for phishing attacks by redirecting users to an attacker's domain from a trusted domain. It is important to note that deployments on Vercel are not affected, and versions prior to 0.9.9 of the next npm package are not vulnerable to this issue.

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

11.1.0

This is the first release that contains the fix.

npm install next@11.1.0

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

Workaround

If upgrading to the latest version of Next.js is not immediately feasible, a possible workaround is to use the pages/404.js file instead of pages/_error.js. Deployments with pages/404.js are not affected by this vulnerability. However, it is still recommended to upgrade to the latest version of Next.js as soon as possible.

Conclusion

In conclusion, the CVE-2021-37699 vulnerability in Next.js allows for open redirects to occur, potentially leading to phishing attacks. It is crucial to upgrade to the latest version of Next.js (version 11.1.0 or newer) to fix this vulnerability and improve the overall security of your application. If immediate upgrading is not possible, using pages/404.js can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for next →

Share this vulnerability

FAQ

Next.js is an open source website development framework used with the React library. It provides a way to build server-side rendered React applications.

Next.js versions between 10.0.5 and 10.2.0, as well as versions 11.0.0 and 11.0.1, are affected by this vulnerability.

The vulnerability allows for open redirects to occur, which can be exploited for phishing attacks by redirecting users to an attacker's domain from a trusted domain.

No, deployments on Vercel are not affected by this vulnerability.

The recommended solution is to upgrade to the latest version of Next.js (version 11.1.0 or newer) to patch the vulnerability.

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

11.1.0

This is the first release that contains the fix.

npm install next@11.1.0

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