Security context
Medium· 6.9GHSA-vxf5-wxwp-m7g9 CVE-2021-37699CWE-601Published Aug 12, 2021

Open Redirect in Next.js

Research this vulnerability

Research is free — Hunters explains how the bug works, the root-cause code pattern, how the fix addresses it, and how to test whether a target is affected, in chat. Investigate & write exploit is a paid run — the engine reads the advisory and fix commits, then builds and validates a working proof-of-concept exploit with reproduction steps.

Affected versions

0.9.9 → fixed in 11.1.0

Details

Next.js is an open source website development framework to be used with the React library. In affected versions specially encoded paths could be used when `pages/_error.js` was statically generated, allowing an open redirect to occur to an external site. In general, this redirect does not directly harm users although it can allow for phishing attacks by redirecting to an attacker's domain from a trusted domain. ### Impact - **Affected:** Users of Next.js between `10.0.5` and `10.2.0` - **Affected:** Users of Next.js between `11.0.0` and `11.0.1` using `pages/_error.js` without `getInitialProps` - **Affected:** Users of Next.js between `11.0.0` and `11.0.1` using `pages/_error.js` and `next export` - **Not affected**: Deployments on Vercel ([vercel.com](https://vercel.com)) are not affected - **Not affected:** Deployments **with** `pages/404.js` - Note that versions prior to 0.9.9 package `next` npm package hosted a different utility (0.4.1 being the latest version of that codebase), and this advisory does not apply to those versions. We recommend upgrading to the latest version of Next.js to improve the overall security of your application. ### Patches https://github.com/vercel/next.js/releases/tag/v11.1.0

The fix

No fix commit could be resolved for this advisory (it may reference an issue tracker or a non-GitHub patch). See the references below.

References