GHSA-2464-fhr4-w9xw: the Next.js SVG image optimizer RCE, who is affected and the fix

GHSA-2464-fhr4-w9xw is a critical (CVSS 9.5) remote code execution flaw in the Next.js Image Optimization API, caused by a memory bug in librsvg, the SVG library inside sharp. It affects next 10.0.0 to 15.5.27 and 16.0.0 to 16.4.0 on glibc-based Linux. Upgrade to 16.4.1 or 15.5.28 or later, and make sure sharp resolves to 0.35.5 or later.

The team behind Keybrum's attacksUpdated 7 min read
GHSA-2464-fhr4-w9xwcritical · CVSS 9.5
Component
Next.js Image Optimization API (/_next/image), through sharp and librsvg (next)
Affected
Next.js 10.0.0 to 15.5.27 and 16.0.0 to 16.4.0, when running on glibc-based Linux
Fixed in
16.4.1 and 15.5.28 (or sharp 0.35.5 or later). Latest releases: 16.4.5 and 15.5.29
Published
October 14, 2026
Exploited in the wild
No public report

In short

  • Affected: next 10.0.0 to 15.5.27 and 16.0.0 to 16.4.0 on glibc-based Linux. Fixed in 15.5.28 and 16.4.1; the latest patches are 15.5.29 and 16.4.5.
  • The fix is a dependency bump to sharp 0.35.5, which ships librsvg 2.63.2. On 15.x, npm install [email protected] keeps an installed sharp 0.34.x: check with npm ls sharp and run npm update sharp.
  • GitHub rates it 9.5 Critical (CVSS 4.0), no account needed. It is not in CISA's KEV catalog as of 8 November 2026, but CISA records a public proof of concept for the librsvg bug.
  • The GitHub Advisory Database lists no CVE id for this advisory as of 8 November 2026. Vercel pairs it with CVE-2026-96889, the CVE of the librsvg flaw.
On this page

What GHSA-2464-fhr4-w9xw is, in plain words

When a page shows a picture with next/image, the browser asks your server for /_next/image?url=..., and the Next.js Image Optimization API decodes, resizes and re-encodes it. The decoding is done by sharp, a Node.js image library built on libvips, whose bundled decoders include librsvg for SVG files.

Vercel's advisory, published with the fix on 14 October 2026, says a memory-related flaw in "an upstream library used for Image Optimization can lead to possible remote code execution (RCE) when Next.js runs on glibc-based Linux." Remote code execution means a stranger runs their own commands on your server, with everything the Node.js process can reach: environment variables, database credentials, API keys. No account is needed.

The upstream library is librsvg. The advisory links CVE-2026-96889, a librsvg use-after-free (code that keeps using memory it already released) published by Red Hat on 23 September 2026 and also named by sharp's advisory, GHSA-wq5f-xc86-pv6w. Next.js did not change its own image code: the fix commits only move the sharp range from 0.35.4 to 0.35.5, the release that ships librsvg 2.63.2.

Severity and exploitation status

SourceRatingDetail
GitHub advisory (CVSS 4.0)9.5 CriticalAV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H: over the network, no account, no user action, with a precondition (AT:P)
Red Hat, for CVE-2026-96889 (CVSS 3.1)7.8 HighScored for librsvg alone, where a person has to open a malicious file (AV:L/UI:R)
CISA (SSVC for CVE-2026-96889, 25 September 2026)Exploitation: proof of conceptNot automatable, total technical impact
CISA KEV catalogNot listedCatalog version 2026.11.06, checked 8 November 2026: CVE-2026-96889 is not in it

The gap between 7.8 and 9.5 is context: on a desktop someone has to open a bad file, while the Image Optimization API decodes images on request for anyone on the internet.

The Hacker News reports that Rafael B. Dias, who reported the librsvg bug, says it is the weakness behind September's next/og advisory, for which a working exploit has been published. We found no report of this advisory being used against Next.js apps.

Who is affected

Your app is in the advisory's scope when both of these are true:

  1. It runs next 10.0.0 to 15.5.27, or 16.0.0 to 16.4.0.
  2. The Next.js server runs on glibc-based Linux: Debian, Ubuntu, Red Hat, Amazon Linux, and Docker images built on them, such as the official node images without alpine in the tag.

The advisory names no setting that limits exposure. Some press coverage ties it to images.dangerouslyAllowSVG: true, which neither the advisory nor Vercel's post mentions, and the November 2026 release fixed a way for an image from an allowed source to get past dangerouslyAllowSVG: false and reach the SVG decoder (GHSA-7qx7-33qx-rqx2, fixed in 15.5.29 and 16.4.5). Do not count on the default config. On Alpine (musl), macOS and Windows the advisory is silent, but sharp 0.35.5 updated librsvg in all its prebuilt binaries: upgrade there too.

SetupWhat applies
Self-hosted on glibc Linux: next start, standalone output in Docker, a VPSIn scope on the affected versions. The server process holds your secrets.
Vercelnext/image requests go through Vercel's own Image Optimization service, which caches results on its CDN. Vercel has not said whether it was exposed. Upgrade anyway.
NetlifyNetlify says its Image CDN serves next/image, so this path "is not exercised on Netlify". next/og ImageResponse in your functions is reachable, but the impact is "limited to a crashed function invocation".
Next.js 14 and olderIn scope from 10.0.0, with no patched release on those lines. See the sharp check below.

If a route of yours builds a social image with ImageResponse from visitor input, the same sharp fix covers that path too. The Next.js security guide covers the other server settings worth reviewing.

How to check your Next.js and sharp versions

Two versions matter: next, and the sharp it loads. Check what your lockfile resolves, not the range in package.json. At the root of the project:

bash
# next: affected from 10.0.0 to 15.5.27 and from 16.0.0 to 16.4.0
npm ls next
pnpm why next
yarn why next

# sharp: the advisory asks for 0.35.5 or later
npm ls sharp
pnpm why sharp
yarn why sharp

# Known advisories in your production dependencies
npm audit --omit=dev
npm audit reports this advisory on next as GHSA-2464-fhr4-w9xw, and the librsvg flaw on sharp as GHSA-wq5f-xc86-pv6w.

The 15.x trap. Next.js 15.5.28 and 15.5.29 still accept sharp 0.34.x (their range is ^0.34.3 || ^0.35.5), while sharp's advisory covers every version below 0.35.5. In our test, a 15.5.20 project kept sharp 0.34.5 after npm install [email protected], and npm audit stopped flagging next but still flagged sharp under GHSA-wq5f-xc86-pv6w. From 16.4.1 the range is ^0.35.5, so the upgrade pulls the fixed version.

On 14.x and older, next does not list sharp: if npm ls sharp prints a version, your project added it. If your build compiles sharp against the system libvips, the system librsvg counts: sharp's advisory asks for 2.63.2, and distributions such as Red Hat ship patched builds under their own version numbers.

How to fix GHSA-2464-fhr4-w9xw

  1. 1

    Upgrade Next.js

    16.4.1 and 15.5.28 are the first fixed releases. Go to the latest on your line, from the November 2026 security release: npm install [email protected] or npm install [email protected].

  2. 2

    Make sure sharp is 0.35.5 or later

    Run npm ls sharp again. If a copy older than 0.35.5 remains, which happens on 15.x, run npm update sharp, or npm install sharp@^0.35.5 if sharp is in your own dependencies. Add the override below so an old copy cannot come back.

  3. 3

    Commit the lockfile and rebuild

    The fix reaches production only through the lockfile. Rebuild without a cached install layer.

  4. 4

    Retire old deployments

    Preview and branch deployments keep the build they were made with, as Netlify's notice warns. Delete the ones you no longer need.

json
{
  "overrides": { "sharp": "^0.35.5" }
}
package.json with npm. If sharp is also in your own dependencies, npm refuses a different override (EOVERRIDE): raise it there instead. With pnpm, the same sharp: "^0.35.5" entry goes under overrides in pnpm-workspace.yaml; with yarn, under resolutions in package.json.

What people miss after the upgrade

  • Your own `sharp` code. If your app calls sharp directly, for avatars or uploads, sharp's advisory applies there too. Its workaround for code stuck on an older version is sharp.block({ operation: ["VipsForeignLoadSvg"] }), which stops SVG decoding.
  • The Node.js binary. sharp's advisory says that to avoid code execution, the node binary should be built as a Position Independent Executable (PIE). Most Linux package managers build Node.js that way; the official Node.js binaries do not. That is hardening, not the fix.
  • npm ls next shows 16.4.5 or 15.5.29 (at least 16.4.1 or 15.5.28) for every app.
  • npm ls sharp shows 0.35.5 or later for every copy, including in other workspaces.
  • The deployed build came from the new lockfile, not a cached image, and npm audit --omit=dev lists neither GHSA-2464-fhr4-w9xw on next nor GHSA-wq5f-xc86-pv6w on sharp.
  • If an affected version ran on glibc Linux and crashed around /_next/image requests without explanation, investigate and rotate the server's secrets.

Keybrum does not test this advisory on a live app: it never runs remote code execution payloads, and no harmless request proves this flaw, so your version check is the answer. On the same endpoint, Keybrum's web.nextjs-image-ssrf attack checks whether the optimizer fetches hosts it should refuse, the precondition behind CVE-2026-94483.

Timeline

DateEvent
23 September 2026CVE-2026-96889, the librsvg use-after-free, published by Red Hat.
27 September 2026sharp 0.35.5 released with librsvg 2.63.2.
6 October 2026sharp advisory GHSA-wq5f-xc86-pv6w published. Next.js 16.4.0 ships, still affected.
14 October 2026Vercel publishes GHSA-2464-fhr4-w9xw with Next.js 16.4.1 and 15.5.28.
22 October 2026The reviewed advisory enters the GitHub Advisory Database, read by npm audit and Dependabot.
3 November 2026Next.js 16.4.5 and 15.5.29 ship, fixing GHSA-7qx7-33qx-rqx2 among others.
8 November 2026Still no CVE id. Not in CISA's KEV catalog (version of 6 November).

Questions

Is Next.js 16.4.1 fixed for the SVG RCE?

Yes. 16.4.1 is the first 16.x release that fixes it: it requires sharp 0.35.5, which carries the fixed librsvg. 16.4.5 is current and adds the November 2026 security fixes, so go there instead.

Am I affected if I never enabled dangerouslyAllowSVG?

The advisory does not make that setting a condition: it names only glibc-based Linux. Some press coverage says exposure needs dangerouslyAllowSVG: true, but Vercel has not said so, and the November 2026 release fixed a way past that setting (GHSA-7qx7-33qx-rqx2). Upgrade either way.

Does GHSA-2464-fhr4-w9xw have a CVE number?

Not of its own as of 8 November 2026: the GitHub Advisory Database lists none. Vercel pairs it with CVE-2026-96889, the CVE of the underlying librsvg flaw. npm audit reports it as GHSA-2464-fhr4-w9xw.

Is Next.js 14 affected by the SVG RCE?

Yes: the range starts at 10.0.0, and no 14.x release fixes it. Run npm ls sharp; if your project has it, bring it to 0.35.5 or later and plan the move to 15.5.29 or 16.4.5.

Sources

  1. 1.GHSA-2464-fhr4-w9xw: Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used, Vercel, GitHub Security Advisory
  2. 2.GHSA-2464-fhr4-w9xw in the GitHub Advisory Database, GitHub Advisory Database
  3. 3.Next.js Security Update for Upstream Vulnerabilities, Next.js
  4. 4.Next.js v16.4.1 release notes, vercel/next.js on GitHub
  5. 5.Next.js v15.5.28 release notes, vercel/next.js on GitHub
  6. 6.[lts-active][next/image] Bump sharp (16.x fix commit), vercel/next.js on GitHub
  7. 7.[lts-maintenance][next/image] Bump sharp (15.x fix commit), vercel/next.js on GitHub
  8. 8.GHSA-wq5f-xc86-pv6w: sharp vulnerability in librsvg dependency CVE-2026-96889, GitHub Advisory Database
  9. 9.CVE-2026-96889, NIST National Vulnerability Database
  10. 10.sharp-libvips v1.3.4: bundled library versions (librsvg 2.63.2), lovell/sharp-libvips on GitHub
  11. 11.Image component: dangerouslyAllowSVG, Next.js Docs
  12. 12.Next.js November 2026 security release, Next.js
  13. 13.GHSA-7qx7-33qx-rqx2: SVG rejection bypass in Image Optimization, Vercel, GitHub Security Advisory
  14. 14.Dependency resolution settings: overrides, pnpm
  15. 15.Known Exploited Vulnerabilities Catalog, CISA
  16. 16.Next.js and React security release (Oct 2026): what to know, Netlify
  17. 17.Image Optimization, Vercel Docs
  18. 18.Next.js Ships Out-of-Band Patch for Two Critical RCE Flaws in Caching and SVG Processing, The Hacker News
  19. 19.next: versions, npm

Your app is public. So are its mistakes.

Check what any attacker can already see in it, free, in ten seconds. The full attack, with proof and fixes: €49 once, or €29 a month on a plan.

or continue with Google or GitHub