Next.js 16.4.0 Is Affected by a Known Security Vulnerability: What to Do

10 min read

Updated November 28, 2026: the October 14 security update has shipped, and there has been another security release since then. The latest stable Next.js version in November 2026 is 16.4.6. If you are on Next.js 15.5, the current patched version is 15.5.29. If you saw a warning about 16.4.0, use the commands below.

Next.js 16.4.0 is affected by a known security vulnerability. We strongly recommend upgrading.

If you see that sentence in Next.js DevTools while running next dev, it is a real warning. Next.js shows it when the version you have installed, such as 16.4.0, has a known security fix available. Here is what to run today:

  • On Next.js 16: npm install next@16.4.6
  • On Next.js 15: npm install next@15.5.29
  • Or the official upgrade tool that Next.js DevTools suggests: npx next@canary upgrade --agent=security.

16.4.1 fixed the October 14 issues. 16.4.5 fixed seven more issues in November. 16.4.6 is a later bug-fix release that includes those security fixes, and it is the current stable version. Official write-ups: the October 14 advisory, the November security release, and our November post with more detail on the later fixes.

If your website or app runs on Next.js, the last few months have been busy. There were two security releases in September, a new version (16.4) came out on October 6, and on October 14 the Next.js team released another security update that fixed two Critical issues. There has been another security release since then.

Most founders don't read framework release notes, and that's fine. If you saw a warning about 16.4.0, or you just need to know what to install, the commands at the top of this page are the place to start. Below is a simple breakdown of what happened in September and October.

First, the short version

  • If your app is on Next.js 16, it should be on 16.4.6.
  • If your app is on Next.js 15, it should be on 15.5.29.
  • The October 14 update shipped as 16.4.1 and 15.5.28. A later November release, 16.4.5 and 15.5.29, fixed more issues. 16.4.6 includes those fixes.
  • Next.js 16.4 is a good release, but you don't need to rush its new features. The security patches are the urgent part.

What happened in September

September 22: a critical fix for social share images

Next.js released 16.3.6 and 15.5.26 as an out-of-band (unscheduled) update. The main issue was in next/og, the feature many sites use to generate those preview images you see when a link is shared on WhatsApp, LinkedIn or X.

The official advisory rated it Critical. Under specific conditions, improper escaping in SVG output from Satori (the library behind these images) could lead to remote code execution, because of problems in other upstream dependencies. In simple words, in the worst case someone could run their own code on your server.

A few details matter here:

  • Only Next.js versions from 16.2.0 up to (but not including) 16.3.6 were affected by the remote code execution issue.
  • Only the Node.js version of ImageResponse was affected. Apps using the Edge version were not.
  • Next.js 15 was not affected by the RCE itself, but 15.5.26 got some related hardening.

September 30: seven more fixes

A week later came the scheduled September security release: 16.3.8 and 15.5.27. This one fixed seven issues. The one rated High was a server-side request forgery problem in Image Optimization.

If your next.config file has images.remotePatterns set up (very common if you load images from a CMS, S3 bucket or any other domain), an attacker-controlled URL that matches one of those allowed patterns could make your server fetch things it shouldn't, like private IP addresses. If you don't use remotePatterns at all, this one doesn't affect you.

The other six were rated Medium or Low. A few that are worth understanding even if you're not technical:

  • Cache poisoning on SSG and ISR pages. In certain setups, one crafted request could make a cached page show the wrong content to every visitor until it's regenerated.
  • Draft content leaking. If you preview unpublished CMS content with Draft Mode and have Cache Components (use cache) turned on, a normal visitor could receive that unpublished content, and it could even get saved into the generated page.
  • The dev server's MCP endpoint. This one is rated Low, but it's interesting. next dev exposes a Model Context Protocol endpoint, the thing AI coding agents use to talk to your running app. It wasn't checking which website a request came from. So a malicious site that your developer opened in their browser while the dev server was running could read things like the project's folder path, code snippets from error reports, the list of routes and development logs. Production sites never serve this endpoint, so your live website was not exposed through it. But it's a good reminder that AI tooling inside the dev setup is now part of your security surface too.

What shipped on October 14

When the September 30 release went out, the Next.js team said that fixes for one Critical and one High issue had to be postponed because of delays in an upstream dependency.

On October 14, 2026, Next.js released that update as 16.4.1 and 15.5.28. It fixed two Critical issues and one High issue: unauthenticated remote code execution in some use cache functions, unauthenticated remote code execution in Image Optimization when SVG files are used, and a denial of service in Server Actions.

The official advisory is on the Next.js blog: Next.js Security Update for Upstream Vulnerabilities. If you are still on 16.4.0 or 15.5.27, don't stop at the October versions. A later November release fixed more issues, and the current versions are 16.4.6 and 15.5.29. We wrote that up in our November security post.

So don't treat this as a one-time update. Someone on the team should own checking for these patches when they come out.

So what is new in Next.js 16.4?

Not everything this month is about security. Next.js 16.4, released on October 6, is a meaningful release, especially for new projects.

Cache Components are now the recommended way

The big message from the Next.js team is that Cache Components are now recommended for every Next.js app. All new apps created with create-next-app have them turned on by default, and they will become the default in Next.js 17.

In plain words, developers mark specific parts of a page as cacheable with a 'use cache' line, instead of Next.js guessing what to cache. So one page can have a cached product list and a live, personalised header. If you've ever heard "the page is showing old data because of caching", this model is meant to make that more predictable.

Tools to keep pages static

There is a new ensureStatic option. A developer can add it to a page or layout, and the build will fail if someone accidentally adds something dynamic to it. For marketing sites, blogs and ecommerce stores, this is useful because dynamic pages cost more server compute. It's a simple guard against surprise hosting bills.

Upgrades with an AI agent

This part is new. Next.js 16.4 adds a next upgrade --agent command that prepares migration guides, codemods and verification steps for a coding agent, so the agent can do the upgrade and check that the app still works.

There is also an experimental agentUpgrade setting. Its default policy, 'security', reminds you or your agent when an upgrade is available that fixes known vulnerabilities in your installed version, while you run next dev or next build. After the month Next.js has had, good timing.

What we would do now

At Krishiv Labs, this is roughly the checklist we follow when something like this happens. You can share it directly with your developer.

  1. Check the version. Open package.json and see which next version is installed. Also check the lock file, because that is what actually gets deployed.
  2. Patch first, upgrade later. If you're on 16.x, move to 16.4.6. If you're on 15.x, move to 15.5.29. Don't mix a security patch with a big feature upgrade in the same deploy.
  3. Look at older versions seriously. If your app is older than the 15.5 or 16.x lines, it's time to plan an upgrade, not just a patch.
  4. Check your image config. If you use images.remotePatterns, keep the allowed domains as tight as possible. Allow only the exact hosts you need.
  5. Apply the later patches. If you have not already moved past 16.4.0 or 15.5.27, upgrade to 16.4.6 or 15.5.29 now.
  6. Turn on Dependabot or Renovate. These tools open a pull request automatically when a dependency has a security fix. Small effort, big help.
  7. Check other dependencies too. Run npm audit (or your package manager's equivalent) after updating Next.js.

If you're on Vercel, a few of these issues don't affect you, as the advisories mention. But most fixes still have to go into your code, so don't skip the update.

A small note on AI coding tools

We use AI coding tools a lot, and they are great at writing features. But they won't patch your dependencies after launch unless someone sets that up. The new next upgrade --agent command helps, but a human still needs to own the job of "keep this app patched".

That's the real lesson from this month. Launching the app is one part of the work. Keeping it updated is the part people forget.

Frequently asked questions

What does this Next.js 16.4.0 warning mean?

If Next.js DevTools says "Next.js 16.4.0 is affected by a known security vulnerability. We strongly recommend upgrading," your installed version has a known security fix available. It is not a false alarm. This reminder is on by default in Next.js 16.4 through the agentUpgrade setting.

What command should I run?

On Next.js 16, run npm install next@16.4.6, then redeploy. On Next.js 15, run npm install next@15.5.29. That is the current fix as of November 2026.

Should I use next upgrade --agent=security?

Yes, that is the command Next.js DevTools suggests. To use the latest upgrade tool even if your app is on an older version, run npx next@canary upgrade --agent=security. It will pick a safe version and can have a coding agent help with the upgrade. You can still do a normal npm install yourself if you prefer.

I'm on Next.js 15. What do I install?

Install 15.5.29. That is the current patched release on the 15.5 line.

Is 16.4.0 safe if I don't use use cache?

No. The official October 14 advisory said to upgrade even if your app does not have similar use cache functions. There is no workaround for that issue. Upgrade anyway.

If you are not sure how to apply the update, we can talk it through for free.

Conclusion

Next.js is still a great choice for web apps, and 16.4 makes it better. But September showed that popular frameworks get serious security fixes often, sometimes back to back.

So today: upgrade to 16.4.6 or 15.5.29, and decide who in your team owns these updates going forward. If you don't have someone for that, at least make sure your developer or agency has it in their monthly maintenance. If you'd like help applying the update, discovery is free.

Sources: Next.js security update, September 22, Next.js September 2026 security release, Upcoming Next.js security update, October 2026, Next.js 16.4 release post, October 14 security update, November 2026 security release, our November post on 16.4.5.