Skip to content

fix(core): bump sharp to 0.35.5 and update node.js to 22 - #3569

Merged
eduardoformiga merged 3 commits into
3.xfrom
cursor/v3-sharp-node-24
Nov 5, 2026
Merged

eduardoformiga merged 3 commits into
3.xfrom
cursor/v3-sharp-node-24

Conversation

@eduardoformiga

@eduardoformiga eduardoformiga commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What's the purpose of this pull request?

FastStore v3 runs on Next.js 13.5, which has no release that fixes GHSA-2464-fhr4-w9xw (critical RCE in Image Optimization with SVG; affected range >= 10.0.0, <= 15.5.27). The root cause is the librsvg bundled in sharp (CVE-2026-96889, GHSA-wq5f-xc86-pv6w), and the advisory's workaround is sharp >= 0.35.5.

Next 13 does not ship its own sharp: it loads the one declared by @faststore/core (^0.32.6, which also has GHSA-rgj7-g3m4-5g8c and GHSA-f88m-g3jw-g9cj).

With the default v3 config this is defense in depth, not a direct exposure. The core uses loader: 'custom', and /_next/image returns 404 in our tests on Node 20, 22 and 24 (we observed this but didn't trace the cause in Next's code). The bump still matters for stores that customized image handling, and it clears the sharp advisories from scanners.

How it works?

  • @faststore/core: sharp ^0.32.6 → ^0.35.5.
  • @faststore/core engines.node: >=18 → >=20.9.0. The binding constraint is [email protected] itself, which declares node >=20.9.0. Yarn 1 already fails the install on Node 18 because of that, whatever the core declares. The core's engines only makes the requirement visible. Only the core changes, because it's the package that pulls sharp.
  • This stays a fix: on purpose. The release runs lerna version --conventional-commits, and a ! / BREAKING CHANGE: would bump the v3 line to 4.0.0, which already exists on npm. The new Node.js minimum goes into the release notes instead.
  • Node.js 18 is end-of-life. FastStore WebOps builds existing projects on Node 20 or 22 (release note), and Next 13 predates Node 24, so:
    • ci.yml runs on a [20, 22] matrix. Chromatic publishes only from the Node 22 job. CI_NODE_VERSION is added to Turbo's globalEnv, so each Node version gets its own remote cache entry instead of reusing the other job's results.
    • release.yml, packages-preview.yml and Volta (root, core, storybook) use Node 22.23.4.
  • pnpm-lock.yaml regenerated with pnpm 9.15.5 and formatted with the repo's prettier, so the diff only contains the sharp change.
  • The CI changes were requested by the FastStore maintainer owning this fix.

Notes for stores (release notes)

  • Node.js >=20.9.0 is now required to install @faststore/core 3.x. Stores on WebOps already build on Node 20 or 22. Local development on Node 18 must move to Node 20.9+ (22 recommended).
  • A store that imports sharp directly now gets 0.35.5 through the core.

How to test it?

  • pnpm build and pnpm test pass on Node 24 (core 155, api 79, sdk 50, cli 38, components 12), and CI covers Node 20 and 22
  • next start of the built core serves the home page
  • Next 13.5.11 optimizeImage with [email protected] outputs webp, avif, png and jpeg at the requested size (reviewed on Node 18.19, 20, 22 and 24)
  • yarn install of [email protected] on Node 18 fails with The engine "node" is incompatible, as expected

Not covered: a real v3 store. Stores pick the fix up after updating @faststore/cli / @faststore/core and rebuilding in WebOps.

Open in Web Open in Cursor 

sharp < 0.35.5 bundles a librsvg vulnerable to CVE-2026-96889 (GHSA-wq5f-xc86-pv6w), which Next.js 13 loads for Image Optimization (GHSA-2464-fhr4-w9xw). sharp 0.35.5 requires Node.js >= 20.9.0, so the core engines field follows it.
@eduardoformiga
eduardoformiga requested a review from a team as a code owner October 30, 2026 22:13
@eduardoformiga
eduardoformiga requested review from hellofanny and lemagnetic and removed request for a team October 30, 2026 22:13
@hellofanny

Copy link
Copy Markdown
Contributor

Review: aprovado com ressalvas

Rodei o PR localmente (worktree limpo). O bump funciona: o lockfile está limpo, o build do core passa, os 155 testes do core passam, e o optimizeImage do Next 13.5.11 com [email protected] gera webp, avif, png e jpeg em Node 18.19, 20, 22 e 24.

Pontos antes do merge

  1. engines.node é breaking, mas o PR é fix:. >=18 → >=20.9.0 faz o install falhar em Node 18 com engine-strict (yarn). Sugiro fix! ou BREAKING CHANGE: no commit. Nada no runtime exige Node 20: o [email protected] rodou até em Node 18.19, então o engines é política do pacote.
  2. O CI deixa de testar no Node das lojas. Os workflows passam de Node 20 para 24.13.0, mas o piso é 20.9 e as lojas rodam em 20 ou 22. Sugiro uma matriz [20, 24] no ci.yml, ou manter 20 no CI e usar 24 só no release. O Next 13.5 também não declara suporte oficial ao Node 24. Build e testes passaram, mas é uma versão fora da matriz dele.
  3. Os outros pacotes não acompanham. @faststore/api ainda declara >=18, e sdk, ui e lighthouse declaram >=10. Vale alinhar ou documentar.
  4. Chromatic. O check "UI Tests" está pendente com "40 changes must be accepted as baselines". Como o PR troca o Node do build do Storybook, vale conferir o diff visual antes de aceitar.

Observação sobre a descrição
O core usa loader: 'custom'. Chamei /_next/image/?url=… em Node 20, 22 e 24, com imagem remota e local, e todas deram 404 (308 com a barra final). Não confirmei a causa no código do Next, só observei o comportamento. Então a CVE do /_next/image provavelmente não é alcançável numa loja com a config padrão. O bump segue correto como defesa em profundidade, mas a descrição passa a ideia de exposição direta.

Para a doc de lojas
Vale acrescentar que uma loja que importa sharp direto, sem declarar a dependência, dependia do hoist do core e pode quebrar com pnpm estrito.

Não coberto
Não testei numa loja real da v3, nem o install em Node 18 com yarn (confio no relato do PR).

FastStore WebOps builds v3 stores on Node.js 20 or 22, and Next.js 13 predates Node.js 24. CI_NODE_VERSION keeps the Turbo cache separate per Node.js version.
@eduardoformiga
eduardoformiga force-pushed the cursor/v3-sharp-node-24 branch from 01de260 to d6ffa7b Compare November 3, 2026 14:10
@cursor cursor Bot changed the title fix(core): bump sharp to 0.35.5 and update node.js to 24 fix(core): bump sharp to 0.35.5 and update node.js to 22 Nov 3, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/cli

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/components

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/core

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/graphql-utils

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/lighthouse

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/sdk

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/ui

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

commit: 01de260

@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/cli

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/components

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/core

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/graphql-utils

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/lighthouse

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/sdk

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/ui

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

commit: d6ffa7b

@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Valeu pela revisão, @hellofanny! Ponto a ponto:

  1. fix: vs. breaking: concordo que é uma mudança de política, mas não dá para usar ! / BREAKING CHANGE: nesta linha. O release roda lerna version --conventional-commits, e um major levaria a v3 para 4.0.0, versão que já existe no npm. Então fica fix:, e o novo mínimo de Node entrou com destaque nas notas para as lojas da descrição.
    Uma correção na premissa: quem bloqueia o Node 18 é o próprio [email protected], que declara node >=20.9.0. Testei o yarn install com Yarn 1 sem nenhuma flag e ele falha no Node 18 por causa disso, independente do que o core declara. O sharp até carrega no Node 18 em runtime, mas o install não chega lá. O engines do core só torna o requisito visível.
  2. Node do CI: concordo, mudei em d6ffa7b. O ci.yml agora roda com matriz [20, 22], e o release, o packages-preview e o Volta usam Node 22.23.4. Adicionei o CI_NODE_VERSION ao globalEnv do Turbo para cada versão do Node ter a própria entrada no cache remoto. Sem isso, o job de Node 20 poderia reaproveitar o resultado do de 22. O Chromatic publica só pelo job de Node 22. Os dois jobs passaram.
  3. Outros pacotes: mantive só o core, porque é ele que puxa o sharp. Subir o engines do api criaria uma restrição sem motivo técnico, e sdk/ui são bibliotecas de browser. A justificativa está na descrição.
  4. Chromatic: concordo, alguém precisa olhar o diff das 40 mudanças antes de aceitar. A troca de Node raramente muda o visual, então suspeito de baseline desatualizado na 3.x, mas não confirmei.

Descrição: ajustei. Agora ela diz que, com a configuração padrão da v3, isto é defesa em profundidade, porque o /_next/image responde 404 (vi o mesmo comportamento que você). A doc das lojas também ganhou a nota sobre o import direto de sharp.

@eduardoformiga
eduardoformiga merged commit 460a015 into 3.x Nov 5, 2026
8 of 10 checks passed
@eduardoformiga
eduardoformiga deleted the cursor/v3-sharp-node-24 branch November 5, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants