Miggo Logo

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

6.9

CVSS Score
3.1

Basic Information

EPSS Score
0.6173%
Published
8/12/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
nextnpm>= 0.9.9, < 11.1.011.1.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability specifically manifests in the static generation logic for pages/_error.js when: 1) No getInitialProps is defined (removing runtime validation), or 2) next export is used (forcing static generation). The advisory indicates improper handling of encoded paths during static HTML generation for error pages, which normally occurs through Next.js' internal static export pipeline. While no explicit function names are disclosed in the advisory, the root cause lies in the framework's path normalization logic during static generation of error pages, as patched in v11.1.0. The combination of version ranges, error page usage patterns, and static export context uniquely identifies this code path as vulnerable.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

N*xt.js is *n op*n sour** w**sit* **v*lopm*nt *r*m*work to ** us** wit* t** R***t li*r*ry. In *****t** v*rsions sp**i*lly *n*o*** p*t*s *oul* ** us** w**n `p***s/_*rror.js` w*s st*ti**lly **n*r*t**, *llowin* *n op*n r**ir**t to o**ur to *n *xt*rn*l s

Reasoning

T** vuln*r**ility sp**i*i**lly m*ni**sts in t** st*ti* **n*r*tion lo*i* *or p***s/_*rror.js w**n: *) No **tIniti*lProps is ***in** (r*movin* runtim* v*li**tion), or *) n*xt *xport is us** (*or*in* st*ti* **n*r*tion). T** **visory in*i**t*s improp*r *