Menu
Guides
Storefront Development

Storefront Development

Next.js and sharp security updates for FastStore stores

Learn how to update Next.js and sharp in FastStore projects to receive the latest security fixes.

8 min read
In this guide, you'll learn how to update Next.js and sharp in your FastStore v2, v3, and v4 project to receive the latest security fixes, depending on your FastStore major version.
VTEX recommends keeping your store on the latest patch of your FastStore line. For the complete list of fixes, see the Next.js security advisories and the sharp security advisories.

Instructions

v4 stores (Next.js 16)

@faststore/core 4.x depends on next@^16.4.3 (and @next/third-parties in the same range). This version comes in through the core's own dependency, so your store doesn't need to declare next in package.json or use resolutions for it.
  1. Update @faststore/cli to the latest release and run the install.
  2. On Yarn 1, delete the next@^16... block from your yarn.lock file and run yarn install.
yarn upgrade next doesn't work for this. Yarn 1 doesn't update transitive dependencies through that command.
  1. To confirm the update, run:

_10
yarn why

The dependency tree must show a single version, 16.4.3 or newer within the 16.x line, coming from @faststore/core.
If your store added resolutions or overrides for ``, remove them. Otherwise, your store stays pinned to its current version and doesn't receive the version set by the core.
@faststore/core and @faststore/cli declare Node >= 20.9.0, the minimum required by Next.js 16.4. In WebOps, v4 stores already build on Node 24.

v2 (Next.js 12) and v3 (Next.js 13) stores

Security fixes for these lines ship in patches of @faststore/core 2.x and 3.x, which bump sharp to ^0.35.5.
  1. Update @faststore/cli (or @faststore/core) to the latest release of your line.
  2. Trigger a new build in WebOps.
sharp 0.35.5 requires Node >= 20.9.0, and these core versions declare that minimum. In WebOps, v2 and v3 stores already build on Node 20 or 22, so nothing changes in production.
Node 18 is out of support. If you still develop locally on it, you need to update, because yarn install fails on sharp's own engine check. For v2 and v3, we recommend Node 22, the version used by WebOps and by the FastStore CI for these lines.

Impact on FastStore stores

FastStore uses the Pages Router, with next build --webpack. The core doesn't use the App Router, Server Actions, use cache (Cache Components), or next/og. Product and CMS images are served directly from {account}.vtexassets.com through the core's own loader, without going through Next's image optimizer. If your store overrides this configuration (for example, with hostname: '**' in remotePatterns, or with a custom loader), you need to replace that list with the hosts you actually use and trigger a new build in WebOps. Stores published on VTEX run on Linux.
Hence, most critical and high-severity advisories don't have an exploitation path in a standard FastStore store. The advisories themselves scope this out:
  • The RCE in use cache requires "App router with Cache Component" and a use cache function that returns typed arrays (GHSA-673q-mjm6-r5xr). The advisory still recommends updating, even if your store doesn't have those features.
  • The Server Actions DoS advisory states: "Applications using Pages Router or not using Server Actions are not vulnerable" (GHSA-p3m5-59mp-jv5r).
  • The middleware bypass affects applications "using App Router built with Turbopack" with a single locale (GHSA-6gpp-xcg3-4w24). The core's proxy.ts runs on the Pages Router with webpack.
Advisory surfaceIn a FastStore store
App Router, Server Actions, use cacheNot part of the core. Only applies to stores that added the App Router on their own
next/og (ImageResponse)The core doesn't generate OG images.
RCE on Windows serversStores on VTEX run on Linux.
Image Optimization (/_next/image) with SVG or AVIFThe core uses loader: 'custom' and doesn't call /_next/image. When the route does respond, the default remotePatterns only accepts {account}.vtexassets.com origins. If your store overrode images in next.config.js with broad origins (such as hostname: '**'), that restriction doesn't apply, and these advisories gain an exploitation path.
Middleware/proxy bypassRequires App Router with Turbopack. The core uses proxy.ts (for password protection and localization) in the Pages Router with webpack.
SSRF in rewrites with a request-controlled destinationRewrites come from discovery.config and are static.
Cache poisoning on SSG/ISR pagesThe closest item to the store's model, since it generates static pages. Medium severity, fixed in 16.3.8.
The practical exposure is low, but the installed version is still flagged by scanners and audits. The bump takes your store out of the affected range.

Image Optimization with SVG and sharp

The SVG RCE (GHSA-2464-fhr4-w9xw) doesn't live in Next's own code. It comes from librsvg, bundled inside sharp, the library Next.js uses to optimize images on Linux glibc (CVE-2026-96889, GHSA-wq5f-xc86-pv6w). The fix is sharp >= 0.35.5. Next.js 16.4.1 now requires that range.
In v4 stores, Next.js 16.4.3 installs its own sharp 0.35.5, and that's the copy the optimizer loads. The same @faststore/core release removes the sharp ^0.32.6 that the core declared without using. As a result, the vulnerable sharp disappears from the store's dependency tree and no longer appears in yarn audit or scanners.
If your store's code imports sharp directly without declaring it as a dependency, it was relying on the core's copy. With Yarn 1, Next's sharp 0.35.5 is still accessible at the root of node_modules. With strict pnpm, that import breaks. In that case, declare sharp in your store's package.json.

v2 and v3 stores

@faststore/core 2.x depends on next ^12.3.1, and 3.x depends on next ^13.5.9. Neither line received a Next.js fix for the SVG RCE: the advisory covers >= 10.0.0, <= 15.5.27. Next.js 12 and 13 don't bundle their own sharp and instead load the sharp ^0.32.6 declared by the core.
In v2, the /_next/image route is active by default. Updating is strongly recommended to apply the latest security fixes. In v3, the core configures its own loader, and the route returns a 404 by default. The update protects stores that customized image handling and clears the warning in scanners. If a customization opened up broad origins in remotePatterns, fix that list: the update reduces the risk, but doesn't eliminate it.
The fix ships in patches of @faststore/core 2.x and 3.x, which bump sharp to ^0.35.5. To receive the fix, update @faststore/cli (or @faststore/core) to the new release of your line and trigger a new build in WebOps.
sharp 0.35.5 requires Node >= 20.9.0, and these core versions now declare that minimum. In WebOps, v2 and v3 stores already build on Node 20 or 22, so nothing changes in production. We tested the build and the Next.js image optimizer for Next.js 12.3 and Next.js 13.5 with sharp 0.35.5 on Node 20, 22, and 24.
Node 18 is out of support. If you still develop locally on it, you need to update, because yarn install fails on sharp's own engine check. For v2 and v3, we recommend Node 22: it's the version used by WebOps and by the FastStore CI for these lines, and Next.js 12 and 13 predate Node 24.
The App Router, Server Actions, and use cache advisories also don't apply to these versions in the standard flow, for the same reason as v4 stores.

16.4.3 compatibility

The bump doesn't change the contract your store relies on: React 18.2, Node >= 20.9.0, and builds with --webpack all remain valid. Next.js 16 notes that React 18 support ends in Next.js 17. This doesn't break your store now.
We validated @faststore/core 4.x with Next.js 16.4.3 (unit tests, a production build covering all Pages Router routes and proxy.ts). We also validated a production store (core 4.2.0): home, listing, PDP, search, and the /_next/data/{buildId}/{locale}/... routes all responded correctly.
Behavior changes worth knowing about:
  • Pages Router /_next/data/*.json responses bring back ETag and Content-Length (16.3). A cache sitting in front of these routes may start revalidating.
  • next dev's WebSocket path changes from /_next/webpack-hmr to /_next/hmr (16.3). This doesn't affect production.
  • With i18n set to a single default locale, the /_next/data/{buildId}/... route without the locale prefix returns 404. This is Pages Router behavior, not something introduced by the bump.

Advisories affecting next@16.2.6

Source: Next.js GitHub Security Advisories. The version listed is the first 16.x release that closes the advisory. 16.4.3 includes every fix below.
Critical
High
Medium and low