GHSA-2464-fhr4-w9xw: Next.js: Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used
Next.js has a critical memory-safety flaw in a library behind its Image Optimization API that can give unauthenticated remote code execution on glibc-based Linux when SVG files are used. Upgrade to next 15.5.28 or 16.4.1, or make sure the `sharp` package Next.js uses is 0.35.5 or newer.
Published Oct 22, 2026 · Analysis Oct 22, 2026
What an attacker can do
The advisory is brief. It says a memory-related vulnerability in an upstream library used for Image Optimization can lead to remote code execution when Next.js runs on glibc-based Linux. The title ties it to SVG files. The page names sharp only in the workaround and does not give the trigger or the memory-corruption mechanism. Do not assume more than that.
The CVSS 4.0 vector is network, low complexity, no privileges and no user interaction, with high impact on confidentiality, integrity and availability, and the attack-requirements element marks a deployment precondition. Practically, an attacker who can make your Next.js server process a crafted image through the image optimizer could run code in the server process. That gives access to environment variables, database credentials, API keys and the host the process runs on.
The advisory does not say whether non-glibc Linux, macOS or Windows are affected. Self-hosted Next.js on common glibc distributions such as Debian and Ubuntu, and Docker images based on them, are the stated risk.
Who is affected
next from 10.0.0 through 15.5.27, and from 16.0.0 through 16.4.0, on glibc-based Linux. Check the Next.js version and the sharp version it resolves:
npm ls next sharpThe fixed sharp is 0.35.5 or later. The advisory's text for the second range reads "> 16.0.0" in one place; the package data uses 16.0.0 and up. To find your libc, run ldd --version in the runtime image: glibc prints GNU libc, and musl-based images such as Alpine differ.
next
- Ecosystem
- npm
- Affected
- >= 10.0.0, <= 15.5.27
- Fixed in
- 15.5.28
- Check
npm ls next
next
- Ecosystem
- npm
- Affected
- >= 16.0.0, <= 16.4.0
- Fixed in
- 16.4.1
- Check
npm ls next
How to fix it
Upgrade Next.js to 15.5.28 (15.x line) or 16.4.1 (16.x line):
npm install [email protected]A patched Next.js makes package managers supply a fixed sharp. Alternatively, make sure the sharp Next.js uses is at least 0.35.5; fresh installs get a fixed version automatically, but a lockfile can pin an old one, so refresh it and rebuild. Redeploy the image, then confirm with npm ls sharp. The advisory lists no other workaround.
How to tell if you were hit
The advisory lists no indicators. Review logs for unusual requests to the /_next/image endpoint, especially with SVG sources or from unfamiliar clients, along with crashes or restarts of the Node process and out-of-memory or segmentation fault messages. Check for unexpected child processes, outbound connections or new files on hosts that serve the optimizer.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
A memory-related vulnerability has been discovered in an upstream library used for Image Optimization can lead to possible remote code execution (RCE) when Next.js runs on glibc-based Linux.
Workaround
Ensure the version of sharp used by Next.js is greater than or equal to 0.35.5. Fresh installs automatically get a fixed version of sharp. Upgrading Next.js to the patched versions will ensure package managers automatically provide a fixed version of sharp to Next.js.
Credited to randomguy6407, rafabd1.
Questions
- Which package is actually vulnerable?
The advisory says an upstream library used for Image Optimization, and its workaround targets
sharp0.35.5 or later. It does not name the exact vulnerable component.- Does it need authentication?
No. The title says unauthenticated and the CVSS vector needs no privileges or user interaction.
- Does it affect Alpine or macOS?
The advisory only names glibc-based Linux and does not say whether other platforms are affected.
- What is the CVE?
The references list CVE-2026-96889 for this advisory. The fixed releases are 15.5.28 and 16.4.1.
References
Read for this analysis:
- https://nvd.nist.gov/vuln/detail/CVE-2026-96889
- https://github.com/vercel/next.js/commit/5e3b687b5edb868b064bdc058d768a7021e7f6ad
- https://github.com/vercel/next.js/commit/9571ec899f063df6533351bec390ccb2cc0af6a3
- https://github.com/vercel/next.js/releases/tag/v15.5.28
- https://github.com/vercel/next.js/releases/tag/v16.4.1
- https://github.com/advisories/GHSA-2464-fhr4-w9xw
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More npm vulnerabilities
All npm entriesGHSA-673q-mjm6-r5xr
Next.js: Unauthenticated Remote Code Execution in `use cache` functions returning typed arrays
critical9.5Oct 22, 2026CVE-2026-94486
Next.js has information disclosure in development server's Model Context Protocol endpoint
low5.4Oct 7, 2026GHSA-vcvr-r3jv-pc5j
Next.js: Remote Code Execution in next/og ImageResponse
critical9.5Sep 30, 2026CVE-2026-75604
Next.js: Unauthenticated Remote Code Execution on windows-hosted servers
critical9.0Sep 8, 2026GHSA-2xp9-vwfh-vxw4
Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used
critical9.5Sep 8, 2026GHSA-9qr9-h5gf-34mp
Next.js is vulnerable to RCE in React flight protocol
critical10.0Dec 3, 2025
