NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

GHSA-2464-fhr4-w9xw: Next.js: Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used

criticalCVSS 4.0 9.5

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 sharp

The 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 sharp 0.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

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 entries