Guide · Next.js · v0 · Cursor · Updated
Next.js October 2026 security update: CVE-2026-96889 and two more bugs, explained
On 14 October 2026, Next.js shipped 16.4.1 and 15.5.28 to fix three bugs, two of them rated critical. If an AI tool picked Next.js for you, through v0, Cursor or a starter template, you may not know which version your app is on, let alone whether these bugs reach it. This is the page we wanted when the advisories landed: what each one is, who it actually reaches, and how to check your own app in about ten minutes. We run Next.js 15.5 for LockShip, and while checking our own upgrade we found one detail on the 15 line that is easy to miss.
New to this? Start with our vibe coding security checklist, eleven checks for any AI-built app, whatever tool made it. This page goes deep on one release.
The short version
The Next.js team announced on 8 October that an out-of-band security update was coming, and published it on 14 October. The fixes are in 16.4.1 for the 16 line and 15.5.28 for the 15 line. There is no fix for 14 or older. If you are below those versions, upgrade.
| Advisory | What it is | Affected next versions | Fixed in |
|---|---|---|---|
| GHSA-2464-fhr4-w9xwCVE-2026-96889critical, CVSS 9.5 | Remote code execution in the Image Optimization API when SVG files are used | >= 10.0.0 and <= 15.5.27; > 16.0.0 and <= 16.4.0 | 15.5.28, 16.4.1 |
| GHSA-673q-mjm6-r5xrcritical, CVSS 9.5 | Remote code execution in use cache functions returning typed arrays | >= 16.0.0 and <= 16.4.0 | 16.4.1 |
| GHSA-p3m5-59mp-jv5rhigh, CVSS 8.2 | Denial of service in the App Router through Server Actions | >= 13.0.0 and <= 15.5.27; >= 16.0.0 and <= 16.4.0 | 15.5.28, 16.4.1 |
The ranges are copied from the three GitHub advisories, including their odd edges: the image advisory’s 16 range starts just after 16.0.0, while the other two include it. The CVSS scores are the advisories’ own, version 4.0.
Check a version now
Type a Next.js version and this box tells you which of the three advisories cover it and where the fix is. It uses the same ranges as the table above. If you don’t know your version yet, check 1 below shows how to find the one your live site runs.
What each one is
1. Code execution through SVG images (CVE-2026-96889)
This one starts outside Next.js. RustSec and Red Hat describe a use-after-free in librsvg, the library that draws SVG files: an SVG with nested XML includes that declare an entity with a name already in use can make librsvg free memory the parser is still using. The CVE record was published on 23 September and says an attacker could use it to crash the program or run their own code.
Next.js resizes images with sharp, and sharp ships librsvg inside it. The sharp advisory says the bug can lead to remote code execution on glibc-based Linux, and that sharp 0.35.5, released on 27 September, brings the fixed librsvg 2.63.2. The Next.js advisory rates it critical, says it is unauthenticated remote code execution in the Image Optimization API when SVG files are used, and gives the same workaround: make sure the sharp that Next.js uses is 0.35.5 or later.
Three details from those advisories are worth knowing:
- It is about Linux with glibc. Debian and Ubuntu use glibc. Alpine uses musl instead, which is outside the condition both advisories name. macOS and Windows aren’t mentioned.
- How Node.js was built matters. The sharp advisory says a
nodebinary compiled as a Position Independent Executable blocks the code execution path, that most Linux package managers build it that way, and that the official Node.js binaries do not. - SVG optimization is off by default. The Next.js image docs say Next.js doesn’t optimize SVG images unless you set
dangerouslyAllowSVG. The advisory doesn’t say whether that setting decides who is exposed, so we wouldn’t treat it as a reason to wait. If you do have it set to true, you are squarely in the case the title describes.
2. Code execution in “use cache” functions (Next.js 16 only)
The second advisory covers 16.0.0 to 16.4.0 and only apps on the App Router with Cache Components turned on. To be exposed, the app needs a use cache function that returns multiple typed arrays (things like Uint8Array). The upstream React advisory calls this “extremely rare.” Most apps won’t have such a function. There is no workaround, and the Next.js team says to upgrade even if your app has none.
3. A request that ties up your server (Server Actions)
The third advisory is rated high rather than critical. Crafted requests to an App Router app with at least one Server Action can use so much CPU that the process stops answering other requests. It covers 13.0.0 to 15.5.27 and 16.0.0 to 16.4.0, and the upstream React advisory describes the same kind of attack on server functions. Apps on the Pages Router, or with no Server Actions, aren’t affected. AI builders reach for Server Actions a lot, so if your app has forms that save things, assume you have some until check 5 says otherwise.
Does it reach my app?
It depends on where and how the app runs. What the vendors themselves have said:
- Your own server or a Docker container. This is the case the image advisory is written for: Next.js running on Linux with glibc, resizing images with the sharp in your
node_modules. Check 4 shows how to see both from the server. - Netlify. Netlify’s changelog note says
next/imagethere goes through Netlify Image CDN, not your function, so that path isn’t exercised. It says the same flaw can still be reached throughnext/ogImageResponse, which does run in your function, with the impact limited to a crashed invocation. It also reminds you that public deploy previews and branch deploys stay vulnerable until they are deleted. - Vercel. For the August 2026 release, Vercel posted a changelog note saying apps on Vercel were protected with no action needed. We looked for an equivalent note for this release on 19 October and didn’t find one. Two of the three bugs are in how your app’s server handles requests, not in image handling, so the honest answer is: upgrade.
- A static export. With
output: 'export'there is no Next.js server at run time. The static export docs list Image Optimization with the default loader and Server Actions as unsupported, and the React advisories say an app whose React code doesn’t use a server isn’t affected. Upgrade anyway, so you don’t carry the old version into the day you add a server.
Six checks for your own app
Everything here is read-only until check 6, and you only need a browser and a terminal in your project folder.
- Find the version your live site runs
- Find the versions in your project
- Make sure sharp moved too
- If you host it yourself, check the server
- See which features your code uses
- Upgrade, redeploy, and check again
01
Find the version your live site runs
What matters is what is deployed, not what package.json says today. Open your live site in Chrome, open DevTools (F12), go to the Console tab and type:
next.versionNext.js sets this in the page itself, so it prints the exact version the site was built with. If it prints an error instead, the page probably isn’t built with Next.js. Paste the number into the box above.
02
Find the versions in your project
In your project folder, npm ls shows which next and which sharp your lockfile actually installs. sharp shows up nested under next, because Next.js pulls it in as an optional dependency.
npm ls next sharpIf you use v0 or another tool that doesn’t give you a terminal, look at package.json for the next version, then ask the tool to run this for you in check 6.
03
Make sure sharp moved too
This is the detail we mentioned. The Next.js advisory says upgrading to the patched versions makes package managers provide a fixed sharp. On 16.4.1 that holds, because its package.json asks for sharp ^0.35.5. On the 15 line it doesn’t always: 15.5.28’s package.json asks for ^0.34.3 || ^0.35.5, so a sharp 0.34.x that is already in your lockfile still fits, and npm has no reason to touch it. There is no fixed 0.34 release.
We wanted to see it happen rather than guess, so we built a test project with a lockfile from Next.js 15.5.20, the kind you would have from a project started in July, and upgraded it with npm 11:
# A project whose lockfile was made with next 15.5.20 (July 2026)
$ npm ls next sharp
└─┬ next@15.5.20
└── sharp@0.34.5
$ npm install next@15.5.28
$ npm ls next sharp
└─┬ next@15.5.28
└── sharp@0.34.5 # still the vulnerable one
$ npm update sharp
$ npm ls next sharp
└─┬ next@15.5.28
└── sharp@0.35.5 # fixedSo if npm ls shows sharp below 0.35.5, run npm update sharp, commit the new lockfile and redeploy. If you would rather pin it so it can’t drift back, add an override and run npm install:
// package.json: pin it, so no old lockfile can hold it back
"overrides": {
"sharp": "0.35.5"
}On LockShip, the upgrade to 15.5.28 left us on sharp 0.35.5, because our lockfile was already on the 0.35 line. Yours may not be.
04
If you host it yourself, check the server
Your laptop isn’t the server. If you run the app on your own machine, a VPS or in Docker, run these where it actually runs. The first prints sharp’s version and the librsvg it carries; you want 0.35.5 2.63.2 or later. The second tells you whether the system uses glibc or musl.
# Run these where the app actually runs (your server or container), in the app folder
node -e "const s=require('sharp');console.log(s.versions.sharp, s.versions.rsvg)"
ldd --version | head -1Remember that a Docker image built from an old lockfile keeps the old sharp until you rebuild it from the new one.
05
See which features your code uses
Bugs 2 and 3 only reach apps that use certain features, and these commands, run from your project folder, show you which ones yours has. They only read files.
# From your project folder: which of the three features does your code use?
ls -d app src/app 2>/dev/null # an app folder means the App Router
grep -rnE --include='*.js' --include='*.jsx' --include='*.ts' --include='*.tsx' --include='*.mjs' \
--exclude-dir=node_modules --exclude-dir=.next "[\"']use (server|cache)" .
grep -nE "cacheComponents|dangerouslyAllowSVG" next.config.*- An
appfolder plus anyuse serverlines: you have Server Actions on the App Router, so bug 3 applies until you upgrade. use cachelines andcacheComponentsin next.config, on Next.js 16: look at what those functions return. If any returns typed arrays, bug 2 is real for you. Either way, upgrade.dangerouslyAllowSVGin next.config: your image optimizer handles SVG, which puts you right in bug 1’s path if sharp is old.
06
Upgrade, redeploy, and check again
The fix itself is small. The Next.js post gives the commands: npm install next@16.4.1 on 16, npm install next@15.5.28 on 15. If you build with an AI tool, you can paste this into its chat:
Upgrade this project's next package to 16.4.1 if it is on Next.js 16, or to 15.5.28 if it is on 15 or older, and upgrade eslint-config-next to match. Then run "npm ls next sharp" and make sure sharp is 0.35.5 or later; if it is not, run "npm update sharp". Show me the old and new versions of next and sharp. Don't change anything else.Read the diff before you accept it. It should touch package.json and the lockfile and nothing else. Then deploy, and repeat check 1 on the live site. The version only changes when a new build goes live. And as Netlify’s note points out for its platform, old preview deployments that are still public keep running the old code until they are deleted, so look at those too.
Where LockShip fits
We built LockShip because checks like number 1 are easy to forget once an app is live. You paste your app’s address and prove you own it. Among other things, the scan reads the Next.js version your deployed pages report and compares it with the advisories it knows by ID: the image optimizer one from this release, React2Shell and the middleware bypass. It doesn’t name the use cache and Server Actions advisories separately, but every version they cover is also inside one of those ranges, so an affected version won’t pass this check. It also counts the Server Actions your pages can call, without calling any.
What it can’t see matters just as much. It can’t read your sharp version, your server’s C library or how Node.js was built, so it tells you to check sharp yourself, which is check 3 and 4. It can’t tell whether you use Cache Components. It never sends requests designed to trigger a bug, so it proves nothing about whether a crafted request would work, only that your version is in the range. Today we also corrected our own scan’s advice: it used to say that upgrading Next.js pulls in the fixed sharp, which, as check 3 shows, isn’t always true on the 15 line.
The summary is free: a score and the single worst thing we found. The $39 Launch Safe certificate adds every finding with a fix prompt for your builder, a PDF and seven days of re-scans while you fix things, and a passing re-scan gives you a badge for your site. After that, Monitor re-scans about once a week for $9 a month, and the badge turns grey if a later scan finds a critical or high issue.
Not sure what your live site runs?
Paste your app’s address, prove you own it, and the scan reads your live Next.js version along with the rest. The summary is free.
Run a free scanBefore you rely on a result, read the disclaimer.
Questions people ask
What is CVE-2026-96889?
It is a use-after-free bug in librsvg, the library that draws SVG images. The RustSec advisory says it happens when an SVG has nested XML includes that declare an entity with a name that already exists. sharp, the image library Next.js uses to resize images, ships librsvg inside it, and that is how the bug reaches Next.js. The Next.js advisory for it is GHSA-2464-fhr4-w9xw. It is the only CVE number in this release; the other two are GitHub advisories only.
I upgraded to Next.js 15.5.28. Am I done?
Probably, but check sharp. next 15.5.28 still accepts sharp 0.34, so if your lockfile already had sharp 0.34.x, it stays there after the upgrade, and only sharp 0.35.5 has the fixed librsvg. We tried it on a test project: upgrading next left sharp at 0.34.5 until we ran npm update sharp. On Next.js 16.4.1 this can’t happen, because it requires sharp 0.35.5 or later.
My app is hosted on Vercel. Do I still need to upgrade?
Yes. For the August 2026 release, Vercel posted a changelog note saying apps on Vercel were protected. When we checked on 19 October, we couldn’t find a matching note for this release, and two of the three bugs are in how your app’s server handles requests, not in image handling. Upgrading takes a few minutes, so we wouldn’t wait to find out.
I’m still on Next.js 14. Is there a patch?
Not on the 14 line. The image advisory covers every version from 10.0.0 up to 15.5.27 and lists 15.5.28 and 16.4.1 as the only fixed releases, and the Server Actions advisory starts at 13.0.0. The sharp advisory gives a workaround you can use while you plan the move: make sure sharp is 0.35.5, or block SVG decoding in sharp.
Has anyone been attacked with these?
None of the three Next.js advisories or the React and sharp advisories behind them says the bugs have been exploited. That is different from React2Shell in December 2025, which was attacked in the wild. It doesn’t change the advice: two of these are rated critical and the fix is a version bump.
Does the free LockShip scan check for these?
It reads the Next.js version your live pages report and compares it with the advisories it knows by ID: the image optimizer one from this release, React2Shell and the middleware bypass. It doesn’t name the use cache and Server Actions advisories separately, but every version they cover is also inside one of those ranges, so an affected site won’t come back as clean on this point. It can’t see your sharp version or whether you use Cache Components.
Keep reading
- Vibe coding security checklist: what to check before you launch an AI-built app
- Is my v0 app secure? A plain check before you launch
- Is my Cursor app secure? A plain check before you launch
- Leaked API keys in your frontend bundle: how to find them and what to do
- A Supabase RLS checklist for vibe-coded apps
Sources
We checked each of these on 19 October 2026. Version ranges come from the GitHub advisories; the sharp behaviour in check 3 is from our own test with npm 11. Advisories get updated, so if anything here disagrees with them, trust the advisory and tell us at hi@lockship.dev.
- Next.js Security Update for Upstream Vulnerabilities, Next.js blog, 14 October 2026
- Upcoming Next.js Security Update, Next.js blog, 8 October 2026
- GHSA-2464-fhr4-w9xw, Image Optimization API and SVG, vercel/next.js
- GHSA-673q-mjm6-r5xr, use cache and typed arrays, vercel/next.js
- GHSA-p3m5-59mp-jv5r, Server Actions denial of service, vercel/next.js
- GHSA-xqc2-xf4c-x3h3, React Server Components, facebook/react
- GHSA-h3gv-c5rc-p453, Server Functions denial of service, facebook/react
- GHSA-wq5f-xc86-pv6w, librsvg in sharp, lovell/sharp
- sharp v0.35.5 release, lovell/sharp
- CVE-2026-96889, CVE record
- RUSTSEC-2026-0305, librsvg, RustSec
- CVE-2026-96889, Red Hat
- Next.js v15.5.28 release notes
- Next.js v16.4.1 release notes
- next@15.5.28 package.json
- next@16.4.1 package.json
- Image component, dangerouslyAllowSVG, Next.js docs
- Static exports, Next.js docs
- cacheComponents, Next.js docs
- use server, Next.js docs
- Next.js and React security release (Oct 2026), Netlify changelog
- Vercel applications are protected from Next.js August 2026 security vulnerabilities, Vercel changelog
- npm ls, npm docs
- npm update, npm docs
- overrides in package.json, npm docs