Skip to content

Next.js and React: Do the vulnerabilities of 2025 and 2026 affect your app?

Since late 2025, the series of reports about Next.js, React and npm hasn’t let up. You read about “React2Shell,” critical vulnerabilities in Next.js and worms in npm packages, and maybe your hosting provider sent a warning too. You can hardly judge on your own whether your app is affected, and the former developer no longer answers or just says it doesn’t affect you. Here you’ll find which vulnerabilities matter, how to tell whether your app is affected and what happens to Next.js 15 on January 31, 2027.

By Dimitri König8 min read

Next.js versions with release date and end of security updates
VersionSecurity updates untilTime leftStatus
Next.js 16LTSlatest 16.4.6released Oct 22, 2025Support ending soonOct 22, 2027332 days left332 days leftSupport ending soon
Next.js 15LTSlatest 15.5.29released Oct 21, 2024Support ending soonExtended until January 31, 2027Jan 31, 202768 days left68 days leftSupport ending soonExtended until January 31, 2027
Next.js 14LTSlatest 14.2.35released Oct 26, 2023No longer supportedExceptional update 14.2.35 on December 11, 2025, because of React2ShellOct 26, 2025expiredexpiredNo longer supportedExceptional update 14.2.35 on December 11, 2025, because of React2Shell
Next.js 13latest 13.5.11released Oct 25, 2022No longer supportedDec 21, 2024expiredexpiredNo longer supported
Next.js 12latest 12.3.7released Oct 26, 2021No longer supportedNov 21, 2022expiredexpiredNo longer supported
Data: endoflife.date and Next.js Support Policy, retrieved Nov 24, 2026. Time left calculated on Nov 24, 2026.

The most important vulnerabilities at a glance

The table of the most important vulnerabilities in Next.js and React since 2025 summarizes what React and Next.js themselves have published (sources at the end of the article). What counts are the versions actually installed in your app.

Date Vulnerability Affected Fixed in
March 21, 2025 CVE-2025-29927, middleware bypass Self-hosted Next.js apps (next start or standalone) that run checks in the middleware, such as authentication. Not Vercel, Netlify or Cloudflare Workers Next.js 15.2.3, 14.2.25, 13.5.9, 12.3.5
December 3, 2025 CVE-2025-55182 “React2Shell,” code execution without login, CVSS 10 Apps with React Server Components on React 19.0 to 19.2.0, including Next.js with the App Router, React Router and Waku React 19.0.1, 19.1.2, 19.2.1 and matching Next.js versions; for Next.js 13.3 to 14.x, exceptionally 14.2.35
December 11, 2025 CVE-2025-55184 and CVE-2025-67779 (denial of service), CVE-2025-55183 (source code of Server Actions exposed) Apps with React Server Components, same as React2Shell latest patch versions of React and Next.js
January 26, 2026 CVE-2026-23864, denial of service Apps with React Server Components, same as React2Shell latest patch versions of React and Next.js
September 22, 2026 Code execution through images from next/og Next.js 16.2.0 to 16.3.5, when outside input flows into generated images Next.js 16.3.6
October 14, 2026 Code execution without login through image optimization with SVG files Next.js 10 to 15.5.27 and 16 to 16.4.0 on Linux servers with glibc Next.js 15.5.28 and 16.4.1. For Next.js 14 and older, the advisory names no fix, only a newer sharp package from 0.35.5
October 14, 2026 CVE-2026-126187, code execution without login in React Server Components, CVSS 9.5 The React packages for Server Components (react-server-dom-webpack, -turbopack, -parcel) 19.0.0 to 19.3.0. In Next.js only 16.0 to 16.4.0 with the App Router and Cache Components, when a use cache function returns several binary data fields (typed arrays) React packages 19.0.9, 19.1.10, 19.2.9 and 19.3.1, Next.js 16.4.1
November 3, 2026 Seven Next.js advisories, one of them “High”: cached data of one tenant could end up with another Mainly apps with Cache Components, some advisories only self-hosted apps or Edge routes Next.js 16.4.5 and 15.5.29

React2Shell: what happened in December 2025

With React Server Components, part of React runs on the server. For this, the browser sends requests that React decodes on the server. That step is exactly where React2Shell, the vulnerability of December 2025, sat: a crafted request was enough to run arbitrary code on the server, without login. That is the most severe category there is, hence the CVSS 10 rating.

React that only runs in the browser was not affected by React2Shell. Affected, on the other hand, was every app whose framework supports Server Components, even if the app itself doesn’t define any Server Functions. For Next.js, this means: the App Router uses Server Components, the older Pages Router doesn’t. In the days that followed, more vulnerabilities in the same packages came out, including one that exposed the source code of Server Actions. So if your app got only a single update after December 3, 2025, it isn’t necessarily up to date.

If your app with Server Components ran unpatched on the internet for weeks after React2Shell, treat the keys on the server as possibly known and replace them.

The middleware bypass of March 2025

The middleware bypass of March 2025 (CVE-2025-29927) exploited an internal Next.js header: Next.js uses it to prevent the middleware from calling itself. An attacker could send that header too, and the middleware was skipped. For apps that check authentication in the middleware, this meant protected pages could be reached without login. Only self-hosted apps were affected; on Vercel, Netlify and Cloudflare Workers, the vulnerability didn’t apply.

The lesson from the middleware bypass still holds today: the Next.js middleware, called “Proxy” since Next.js 16, is a first barrier. The actual check of whether someone may see or change data also belongs where the data is loaded.

2026: over 50 security advisories for Next.js

In 2026, Next.js published over 50 security advisories on GitHub, several of them critical. Two examples: in September, a vulnerability in image generation with next/og, and in October, one in image optimization that allowed code execution without login. The second one affected Next.js versions all the way back to version 10. On November 3, seven advisories followed at once. And warnings sometimes arrive late: GitHub has only been flagging the critical React vulnerability from October 14 to affected projects since November 10.

With over 50 security advisories in 2026 alone, a Next.js app needs updates every few weeks. Fixes are only available for supported versions: as of November 2026, Next.js 16 and, until the end of January 2027, Next.js 15.

The npm supply chain: attacks on packages instead of your app

Attacks on the npm supply chain don’t target React or Next.js themselves, but the packages your app installs along with them:

  • September 8, 2025: Through a phishing email to the maintainer, chalk, debug and about 18 other very widely used npm packages were taken over. The malicious code ended up in the frontend and swapped cryptocurrency addresses in the browser.
  • September 2025: The “Shai-Hulud” worm stole access keys and published itself in more than 500 other npm packages. The US agency CISA issued a warning. A second wave followed in November 2025.
  • December 9, 2025: npm revoked all classic access tokens. Build pipelines that used them to publish packages stopped working that day.
  • May 11, 2026: 84 malicious versions in 42 TanStack packages, installable for a few hours. The malicious code ran during installation and collected keys for cloud, GitHub and npm.
  • August 4, 2026: “ChainDrop” affected more than 400 npm packages and, like Shai-Hulud, spread itself further.

With attacks on npm packages, the most dangerous moment is installation, on developer laptops and in build pipelines, where keys for servers, the database and deployment are stored. Protection comes from a lock file in the repository, builds with npm ci that install exactly those versions, and keys that are only stored where they are needed. After ChainDrop, Microsoft also recommends installing freshly published package versions only after a waiting period.

How to check whether your app is affected

  1. Look at the installed versions. What counts is the lock file (package-lock.json, pnpm-lock.yaml or yarn.lock), not package.json, which often only lists ranges like ^15.0.0. In the project folder, npm ls next react react-dom shows what is actually installed.
  2. App Router or Pages Router? If the Next.js project has an app folder (or src/app) with page.tsx files, your app uses the App Router and therefore Server Components.
  3. Where does the app run? On Vercel, Netlify, Cloudflare Workers or self-hosted with next start, in Docker or on your own server. Which vulnerabilities apply depends on that.
  4. What is live? The state in the repository and the state in production often differ. Check the last successful deployment, not just the code.
  5. Run npm audit. It provides a first list of known vulnerabilities. Whether a finding really affects your app depends on whether your app uses the affected part.
  6. Check the time windows. Was anything installed or built on one of the days when malicious npm packages were circulating? Then it’s worth looking at the history of the lock file. If there’s a match, all keys from development and the pipeline should be replaced.

If you find signs that someone has already exploited a vulnerability in your Next.js or React app, the article Website or application hacked: the first steps helps. If your business has come to a standstill because of it, help from Unique-P starts with the emergency fix.

Next.js 15 ends on January 31, 2027

Each Next.js major version stays active until the next one is released and then gets maintenance with security fixes, normally for two years from its release. For Next.js 15, that would have been October 21, 2026; Vercel extended the deadline to January 31, 2027. Next.js 14 and older only get an update in rare cases, as with React2Shell in December 2025.

The step to Next.js 16 brings some required changes:

  • Node.js 20.9 or newer and TypeScript 5.1 or newer. The Node.js deadlines are in the article Node.js End of Life.
  • params, searchParams, cookies() and headers() can only be used asynchronously.
  • middleware.ts is now called proxy.ts. The old file still works for now but is deprecated.
  • Turbopack is the new default build tool; custom Webpack configurations need a look.

A Next.js codemod takes care of part of the required changes for the upgrade to Next.js 16. Moving from the Pages Router to the App Router isn’t required for the upgrade and can be done page by page later. If your app doesn’t run on Vercel, there has been a stable interface for other platforms since Next.js 16.2, and running with next start on your own server is officially documented.

What if nobody knows your app anymore?

A Next.js app needs someone who reads security advisories, assesses them and installs the updates promptly. If the developer is gone, the Takeover Assessment from Unique-P with its JavaScript and TypeScript module shows which versions are running, which vulnerabilities are open and where keys are stored. After that, maintenance and support keeps Next.js, React and packages up to date. If your app was built with v0, Lovable or another AI tool, also read the warning signs before your first real customer. What else is typical for JavaScript applications is covered on the JavaScript and TypeScript page.

Sources

  1. [1]Postmortem on Next.js Middleware bypass · Vercel
  2. [2]Critical Security Vulnerability in React Server Components · React, December 3, 2025
  3. [3]Next.js Security Advisories · GitHub
  4. [4]Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used (GHSA-2464-fhr4-w9xw) · Next.js, October 14, 2026
  5. [5]Unauthenticated Remote Code Execution in React Server Components (CVE-2026-126187) · React, October 14, 2026, in the GitHub Advisory Database since November 10, 2026
  6. [6]Unauthenticated Remote Code Execution in use cache functions returning typed arrays (GHSA-673q-mjm6-r5xr) · Next.js, October 14, 2026
  7. [7]November 2026 Security Release · Next.js, November 3, 2026
  8. [8]Remote Code Execution in next/og ImageResponse (GHSA-vcvr-r3jv-pc5j) · Next.js, September 22, 2026
  9. [9]Next.js Support Policy · Vercel
  10. [10]Next.js 16 · Vercel, October 21, 2025
  11. [11]Next.js Across Platforms: Adapters, OpenNext, and Our Commitments · Vercel, March 25, 2026
  12. [12]Migrating to the App Router · Next.js
  13. [13]React Versioning Policy · React
  14. [14]20 Popular npm Packages Compromised (chalk, debug, strip-ansi …) · StepSecurity, September 8, 2025
  15. [15]Widespread Supply Chain Compromise Impacting npm Ecosystem · CISA, September 23, 2025
  16. [16]npm classic tokens revoked · GitHub, December 9, 2025
  17. [17]npm Supply-Chain Compromise Postmortem · TanStack
  18. [18]ChainDrop: Anatomy of a self-propagating worm · Microsoft Security, August 4, 2026

Frequently asked questions.

Is my app affected by React2Shell?

Your app is affected by React2Shell only if it uses React Server Components, for example Next.js with the App Router, React Router with Server Components or Waku, and has React 19.0 to 19.2.0 installed. A React app that only runs in the browser was not affected. Even without its own Server Functions, an app can be vulnerable if its framework supports Server Components. The lock file with the installed versions gives you clarity.

Our app runs on Vercel. Does that protect us?

Hosting on Vercel protects a Next.js app only partly. The middleware bypass of March 2025 didn’t affect apps on Vercel, Netlify or Cloudflare Workers, only self-hosted ones. For React2Shell, hosting providers deployed temporary protection rules, but the React team explicitly advises against relying on them. Against vulnerabilities in your app’s own code, only the update helps.

Is running npm audit enough?

npm audit is enough as a start: it shows known vulnerabilities in the installed package versions. But it doesn’t tell you whether your app even uses the affected part, whether a malicious package was once installed and grabbed keys, or whether a package hasn’t been maintained by anyone for years.

GitHub or npm audit reports a critical React vulnerability. What does that mean?

Since November 10, 2026, the React vulnerability CVE-2026-126187 from October 2026 has been in GitHub’s advisory database, which Dependabot and npm audit also use. That’s why it now shows up as a warning in many projects. It allows code execution without login, but according to React only in extremely rare cases, and in Next.js only with Cache Components. You should still install the update. For Next.js, what counts is the Next.js version, 16.4.1 or newer, because Next.js ships its own copy of the React packages for Server Components.

What happens to Next.js 15 after January 31, 2027?

After January 31, 2027, no more security updates are released for Next.js 15; only Next.js 16 is maintained. Your app keeps running, but new vulnerabilities stay open. Next.js 16 requires at least Node.js 20.9 and TypeScript 5.1, and there are changes to params, cookies() and the middleware. Plan the upgrade to Next.js 16 for the coming weeks.

Our app uses React without Next.js. Do we need to do anything?

A React app without Next.js that only runs in the browser, for example as a single-page app with Vite, was not affected by the vulnerabilities in React Server Components. The attacks on npm packages still affect it, and a build with Create React App depends on a tool that has been deprecated since February 2025. React itself commits to backporting security fixes to all affected major versions.

What should we do if our app has already been attacked?

After an attack on your app, don’t clean up on your own. First secure the logs and the current state, take the app offline if necessary and replace all keys that were stored on the server, for example for the database, payment provider and email delivery. After that, the app is rebuilt from a clean state and updated.

Emergency fix after a hack