Skip to content

fix(deps): override sharp to 0.35 to clear inherited libvips CVEs (#4400) - #4449

Merged
cixzhang merged 1 commit into
meta:mainfrom
AKnassa:rocky/issue-4400-sharp-cve
Jul 28, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
AKnassa:rocky/issue-4400-sharp-cve

Conversation

@AKnassa

@AKnassa AKnassa commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #4400.

next pulls sharp as an optional dependency for image optimization and resolves 0.34.5, which inherits four libvips advisories: CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, CVE-2026-35591.

They're patched in sharp 0.35.0 — a semver-major bump on the 0.x line, so next's own ^0.34 range can never reach it. That's why this is an override rather than a lockfile refresh. Both next entries in the tree (15.5.20 and 16.3.0-preview.5) resolve through it.

# pnpm-workspace.yaml → overrides
sharp: ^0.35.3

The platform packages move with it — @img/sharp-libvips-* goes 1.2.4 → 1.3.2, which is where the actual fix lives.

sharp is already in allowBuilds, so the native postinstall path is unchanged. 0.35.3 published 2026-07-01, well clear of the repo's 7-day minimumReleaseAge.

The override is temporary by construction, and the inline comment says so: drop it once next depends on 0.35 itself.

Verification

The issue flagged that an override "needs verification that next's image optimization still functions correctly". Since the risk here is the native binary and the next integration rather than the resolution, I checked past the lockfile:

  • sharp 0.35.3 loads and reports libvips 8.18.3
  • it round-trips a real encode — sharp({create}).png().toBuffer() returns a valid PNG
  • pnpm build (core, lab, charts, vega, 7 themes) — succeeds
  • pnpm -F @astryxdesign/docsite build — succeeds; a full next build with prerendering across ~270 paths, which is where image optimization would surface
  • pnpm test — 384 files, 7871 tests, all pass

No changeset

This touches no published package's source. Matches the two most recent dependency-override PRs, #3889 and #4398, which were both pnpm-lock.yaml + pnpm-workspace.yaml only.

Note on the sibling issue

#4401 (@hono/node-server 1.x → 2.x) is not covered here. The overrides block already pins hono: ^4.12.25, but that's the framework package, not @hono/node-server, so #4401 is genuinely still open and needs its own change.

next pulls sharp as an optional dependency for image optimization and
resolves 0.34.5, which inherits four libvips advisories: CVE-2026-33327,
CVE-2026-33328, CVE-2026-35590 and CVE-2026-35591.

They are patched in sharp 0.35.0, a semver-major bump on the 0.x line, so
next's own `^0.34` range can never reach it — hence an override rather than a
lockfile refresh. Both next entries in the tree (15.5.20 and
16.3.0-preview.5) resolve through it, and the platform packages move with
it: `@img/sharp-libvips-*` goes 1.2.4 to 1.3.2, which is where the actual
fix lives.

sharp is already in `allowBuilds`, so the native postinstall is unchanged.
0.35.3 published 2026-07-01, well clear of the repo's 7-day
`minimumReleaseAge`.

The override is temporary by construction — the comment says to drop it once
next depends on 0.35 itself.

Verified beyond the lockfile, since the concern with this bump is the native
binary and next's image pipeline rather than the resolution:
  - sharp 0.35.3 loads and reports libvips 8.18.3
  - it round-trips a real encode (create -> .png() -> Buffer)
  - `pnpm build` (core, lab, charts, vega, 7 themes) succeeds
  - `pnpm -F @astryxdesign/docsite build` succeeds — a full next build with
    prerendering, which is where image optimization would surface
  - `pnpm test`: 384 files, 7871 tests, all pass

No changeset: this touches no published package's source, matching meta#3889 and
meta#4398, which were both lockfile + pnpm-workspace.yaml only.

Fixes meta#4400
@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 28, 2026 6:13am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 28, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | View full report

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you!

@cixzhang
cixzhang marked this pull request as ready for review July 28, 2026 23:36
@cixzhang
cixzhang enabled auto-merge (squash) July 28, 2026 23:36
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Jul 28, 2026
@cixzhang
cixzhang merged commit 4e8b7d1 into meta:main Jul 28, 2026
23 checks passed
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Jul 29, 2026
…atalog

Re-verified every override entry by removing it, re-resolving the lockfile, and running pnpm audit. The entries that no longer do anything useful are removed: stylex, tmp, @babel/core, hono, both scoped js-yaml floors and the picomatch trio carried over from yarn resolutions all resolve identically without the override, and prettier and minimatch were dedup-only forces whose removal lets consumers follow their own declared ranges.

brace-expansion ^2.1.2 goes too. It was added in meta#4398 as a security floor, but 2.x sits below the declared range of every consumer in the graph — minimatch@10 (via @eslint/config-array) declares ^5.0.5, minimatch@3 (via @babel/cli) declares ^1.1.7 — so it was a downgrade, not a floor. It stayed invisible only because the equally stale minimatch ^9.0.7 force held minimatch on a line that still used brace-expansion's default CJS export. Dropping minimatch alone lets @eslint/config-array resolve minimatch 10, which calls the named `expand` that 2.x does not have, and ESLint dies with "brace_expansion_1.expand is not a function". Dropping both lets each consumer resolve inside its own range (5.0.7 and 1.1.16) and ESLint runs clean.

The entries that guard live advisories stay, documented with the dependent that pins the vulnerable version and the condition for deleting them: postcss ^8.5.18 (next@15 pins 8.4.31), dompurify ^3.4.12 ([email protected] pins 3.2.7, 16 advisories), esbuild >=0.28.1 ([email protected] resolves 0.27.7), fast-uri ^3.1.4 (meta#4398), sharp ^0.35.3 (meta#4449), and the read-yaml-file 2.x lift.

Both js-yaml chains move to ^5.2.2, adopting the fix in meta#4402 — the previous '>=4.2.0' floor was unbounded and resolved onto js-yaml 5.2.1, inside the vulnerable >=5.0.0 <=5.2.1 range. Written as a caret rather than '>=' so a future js-yaml 6 cannot repeat that. [email protected] is added to minimumReleaseAgeExclude so the floor can resolve.

Workspace-wide version pins that lived in overrides move to the pnpm catalog alongside vite: @stylexjs/stylex, @stylexjs/babel-plugin, prettier, esbuild. Peer ranges stay untouched — they are consumer contracts, not workspace pins.

pnpm audit goes from 12 findings to 10; the remaining 10 match main's baseline exactly.
@github-actions
github-actions Bot deleted the rocky/issue-4400-sharp-cve branch July 29, 2026 08:37
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Jul 31, 2026
…atalog

Re-verified every override entry by removing it, re-resolving the lockfile, and running pnpm audit. The entries that no longer do anything useful are removed: stylex, tmp, @babel/core, hono, both scoped js-yaml floors and the picomatch trio carried over from yarn resolutions all resolve identically without the override, and prettier and minimatch were dedup-only forces whose removal lets consumers follow their own declared ranges.

brace-expansion ^2.1.2 goes too. It was added in meta#4398 as a security floor, but 2.x sits below the declared range of every consumer in the graph — minimatch@10 (via @eslint/config-array) declares ^5.0.5, minimatch@3 (via @babel/cli) declares ^1.1.7 — so it was a downgrade, not a floor. It stayed invisible only because the equally stale minimatch ^9.0.7 force held minimatch on a line that still used brace-expansion's default CJS export. Dropping minimatch alone lets @eslint/config-array resolve minimatch 10, which calls the named `expand` that 2.x does not have, and ESLint dies with "brace_expansion_1.expand is not a function". Dropping both lets each consumer resolve inside its own range (5.0.7 and 1.1.16) and ESLint runs clean.

The entries that guard live advisories stay, documented with the dependent that pins the vulnerable version and the condition for deleting them: postcss ^8.5.18 (next@15 pins 8.4.31), dompurify ^3.4.12 ([email protected] pins 3.2.7, 16 advisories), esbuild >=0.28.1 ([email protected] resolves 0.27.7), fast-uri ^3.1.4 (meta#4398), sharp ^0.35.3 (meta#4449), and the read-yaml-file 2.x lift.

Both js-yaml chains move to ^5.2.2, adopting the fix in meta#4402 — the previous '>=4.2.0' floor was unbounded and resolved onto js-yaml 5.2.1, inside the vulnerable >=5.0.0 <=5.2.1 range. Written as a caret rather than '>=' so a future js-yaml 6 cannot repeat that. [email protected] is added to minimumReleaseAgeExclude so the floor can resolve.

Workspace-wide version pins that lived in overrides move to the pnpm catalog alongside vite: @stylexjs/stylex, @stylexjs/babel-plugin, prettier, esbuild. Peer ranges stay untouched — they are consumer contracts, not workspace pins.

pnpm audit goes from 12 findings to 10; the remaining 10 match main's baseline exactly.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Aug 20, 2026
…atalog

Re-verified every override entry by removing it, re-resolving the lockfile, and running pnpm audit. The entries that no longer do anything useful are removed: stylex, tmp, @babel/core, hono, both scoped js-yaml floors and the picomatch trio carried over from yarn resolutions all resolve identically without the override, and prettier and minimatch were dedup-only forces whose removal lets consumers follow their own declared ranges.

brace-expansion ^2.1.2 goes too. It was added in meta#4398 as a security floor, but 2.x sits below the declared range of every consumer in the graph — minimatch@10 (via @eslint/config-array) declares ^5.0.5, minimatch@3 (via @babel/cli) declares ^1.1.7 — so it was a downgrade, not a floor. It stayed invisible only because the equally stale minimatch ^9.0.7 force held minimatch on a line that still used brace-expansion's default CJS export. Dropping minimatch alone lets @eslint/config-array resolve minimatch 10, which calls the named `expand` that 2.x does not have, and ESLint dies with "brace_expansion_1.expand is not a function". Dropping both lets each consumer resolve inside its own range (5.0.7 and 1.1.16) and ESLint runs clean.

The entries that guard live advisories stay, documented with the dependent that pins the vulnerable version and the condition for deleting them: postcss ^8.5.18 (next@15 pins 8.4.31), dompurify ^3.4.12 ([email protected] pins 3.2.7, 16 advisories), esbuild >=0.28.1 ([email protected] resolves 0.27.7), fast-uri ^3.1.4 (meta#4398), sharp ^0.35.3 (meta#4449), and the read-yaml-file 2.x lift.

Both js-yaml chains move to ^5.2.2, adopting the fix in meta#4402 — the previous '>=4.2.0' floor was unbounded and resolved onto js-yaml 5.2.1, inside the vulnerable >=5.0.0 <=5.2.1 range. Written as a caret rather than '>=' so a future js-yaml 6 cannot repeat that. [email protected] is added to minimumReleaseAgeExclude so the floor can resolve.

Workspace-wide version pins that lived in overrides move to the pnpm catalog alongside vite: @stylexjs/stylex, @stylexjs/babel-plugin, prettier, esbuild. Peer ranges stay untouched — they are consumer contracts, not workspace pins.

pnpm audit goes from 12 findings to 10; the remaining 10 match main's baseline exactly.

� Conflicts:
�	pnpm-workspace.yaml
cixzhang pushed a commit that referenced this pull request Aug 22, 2026
…atalog (#4101)

* chore(deps): prune stale pnpm overrides, move workspace pins to the catalog

Re-verified every override entry by removing it, re-resolving the lockfile, and running pnpm audit. The entries that no longer do anything useful are removed: stylex, tmp, @babel/core, hono, both scoped js-yaml floors and the picomatch trio carried over from yarn resolutions all resolve identically without the override, and prettier and minimatch were dedup-only forces whose removal lets consumers follow their own declared ranges.

brace-expansion ^2.1.2 goes too. It was added in #4398 as a security floor, but 2.x sits below the declared range of every consumer in the graph — minimatch@10 (via @eslint/config-array) declares ^5.0.5, minimatch@3 (via @babel/cli) declares ^1.1.7 — so it was a downgrade, not a floor. It stayed invisible only because the equally stale minimatch ^9.0.7 force held minimatch on a line that still used brace-expansion's default CJS export. Dropping minimatch alone lets @eslint/config-array resolve minimatch 10, which calls the named `expand` that 2.x does not have, and ESLint dies with "brace_expansion_1.expand is not a function". Dropping both lets each consumer resolve inside its own range (5.0.7 and 1.1.16) and ESLint runs clean.

The entries that guard live advisories stay, documented with the dependent that pins the vulnerable version and the condition for deleting them: postcss ^8.5.18 (next@15 pins 8.4.31), dompurify ^3.4.12 ([email protected] pins 3.2.7, 16 advisories), esbuild >=0.28.1 ([email protected] resolves 0.27.7), fast-uri ^3.1.4 (#4398), sharp ^0.35.3 (#4449), and the read-yaml-file 2.x lift.

Both js-yaml chains move to ^5.2.2, adopting the fix in #4402 — the previous '>=4.2.0' floor was unbounded and resolved onto js-yaml 5.2.1, inside the vulnerable >=5.0.0 <=5.2.1 range. Written as a caret rather than '>=' so a future js-yaml 6 cannot repeat that. [email protected] is added to minimumReleaseAgeExclude so the floor can resolve.

Workspace-wide version pins that lived in overrides move to the pnpm catalog alongside vite: @stylexjs/stylex, @stylexjs/babel-plugin, prettier, esbuild. Peer ranges stay untouched — they are consumer contracts, not workspace pins.

pnpm audit goes from 12 findings to 10; the remaining 10 match main's baseline exactly.

� Conflicts:
�	pnpm-workspace.yaml

* chore: retrigger CI (known Markdown perf-test flake, fixed by #4099)

* chore(deps): address #4101 review, prune 6 more pnpm overrides

Per cixzhang's review: floor brace-expansion on the 5.x line (^5.0.9, inside minimatch@10's own ^5.0.5) instead of re-pinning 2.x and forcing minimatch alongside it — minimatch now resolves on its own. Also move @stylexjs/postcss-plugin into the catalog; it was left literal next to the now-catalog stylex/babel-plugin pins and would have silently drifted on the next bump.

Re-verified every remaining override against the current lockfile the same way: drop it, re-resolve, check what actually lands. hono, @changesets/parse>js-yaml, fast-uri, ip-address, and nanoid all resolve to safe versions unforced now, so they're pruned (hono also drops out of minimumReleaseAgeExclude). @hono/node-server and read-yaml-file (+ its js-yaml floor) stay — pnpm audit reports clean without them, but the actual resolved versions without the override are vulnerable (@hono/node-server 1.19.17, read-yaml-file 1.x pulling js-yaml 3.x), which audit's advisory feed doesn't catch.

pnpm install --frozen-lockfile, pnpm audit (0 findings), and eslint all pass on the result.

* chore(deps): bump docsite's MCP SDK to drop the @hono/node-server override

@modelcontextprotocol/sdk 1.30.0 widens its @hono/node-server range to '^1.19.9 || ^2.0.5', so the patched 2.x line resolves on its own now — no override needed to hold it there. Verified: @hono/node-server resolves to 2.1.0, hono to 4.13.1, pnpm audit stays clean.

pnpm install --frozen-lockfile and eslint pass on the result.

This branch was successfully deployed

1 active deployment
Preview — 9df43ff6 Deployed Jul 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deps: sharp 0.34 -> 0.35 (major bump, inherited libvips CVEs)

2 participants