Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/fix-create-sei-next-sharp-advisories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@sei-js/create-sei': patch
---

Bump the Next template's `next` and `sharp` pins to clear three newly published advisories.

The generated-app smoke audits every variant and fails on any high or critical finding. Three advisories landed against the pinned versions, so the check went red without any change to the template:

- `GHSA-p293-qw3h-jr36` — critical, unauthenticated RCE on Windows-hosted Next.js servers, `>=13.4.0 <15.5.24`.
- `GHSA-2xp9-vwfh-vxw4` — critical, unauthenticated RCE in the Image Optimization API when AVIF files are used, `>=10.0.0 <15.5.24`.
- `GHSA-rgj7-g3m4-5g8c` — high, heap overflow in Sharp's bundled libheif decoder, `<0.35.4`.

`next` moves `15.5.21` to `15.5.25` and the `sharp` override `0.35.3` to `0.35.4`, both inside their pinned minors.

Next also widened its own Sharp declaration to `^0.34.3 || ^0.35.4`, so the pinned override now sits inside the range Next supports. The image notes in the template README and `next.config.mjs` said the opposite and are corrected: images stay unoptimized to avoid requiring a native Sharp build, which is a template choice rather than a security tradeoff. The `sharp` override itself still is one, and both notes now say so — the `0.34.x` half of Next's range remains inside the advisory, making `0.35.4` the floor rather than a free upgrade.

The remaining `decode-uri-component` finding is moderate and does not block the smoke.
6 changes: 4 additions & 2 deletions packages/create-sei/templates/next-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ bun run build

## Image handling

Next.js image optimization is disabled because Next 15.5.21 declares only vulnerable Sharp 0.34.x releases. The manifest resolves secure Sharp 0.35.x for audit safety, while images are served unoptimized until Next.js supports that Sharp line.
Next.js image optimization is disabled so the generated app needs no native Sharp build. Turning it on is a template choice rather than a security tradeoff.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] Accurate as far as it goes, but "turning it on is a template choice" understates one constraint: the release smoke asserts the rendered home page contains no /_next/image (packages/create-sei/scripts/smoke-generated-app.ts:323), so flipping unoptimized to false fails CI until that assertion is updated too. Worth a half-sentence here so the next person doesn't discover it from a red check.


The manifest's `sharp` override is a separate matter and has to stay. The pinned Next 15 line declares Sharp `^0.34.3 || ^0.35.4`, and the `0.34.x` half of that range is still inside [GHSA-rgj7-g3m4-5g8c](https://github.com/advisories/GHSA-rgj7-g3m4-5g8c), so `0.35.4` is the advisory floor. Loosening or removing the override reintroduces a high audit finding whether or not optimization is enabled.

## Development bundler

`bun run dev` uses the Next 15 webpack default. Do not add `--turbopack`: Next 15.5.21 cannot express the required `false` alias for MetaMask SDK's mobile-only storage import in Turbopack without adding a synthetic replacement module. The production build and smoke use the validated webpack alias in `next.config.mjs`.
`bun run dev` uses the Next 15 webpack default. Do not add `--turbopack`: the pinned Next 15 line cannot express the required `false` alias for MetaMask SDK's mobile-only storage import in Turbopack without adding a synthetic replacement module. The production build and smoke use the validated webpack alias in `next.config.mjs`.

## Sei brand

Expand Down
7 changes: 5 additions & 2 deletions packages/create-sei/templates/next-template/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ const nextConfig = {
ignoreDuringBuilds: true,
},
images: {
// Next 15.5.21 declares vulnerable Sharp 0.34.x. Keep the secure 0.35.x
// override for resolution, but do not rely on its unsupported optimizer API.
// Images stay unoptimized so the generated app needs no native Sharp
// build. Keep the manifest's Sharp override: Next declares
// `^0.34.3 || ^0.35.4`, and the 0.34.x half is still inside
// GHSA-rgj7-g3m4-5g8c, so 0.35.4 is the advisory floor. Loosening that
// pin reintroduces a high finding even though this flag is off.
unoptimized: true,
},
webpack: (config) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/create-sei/templates/next-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@tailwindcss/postcss": "4.3.3",
"@tanstack/react-query": "5.85.3",
"ethers": "6.17.0",
"next": "15.5.21",
"next": "15.5.25",
"pino-pretty": "13.1.3",
"postcss": "8.5.26",
"react": "19.1.2",
Expand All @@ -46,7 +46,7 @@
"@metamask/sdk": "0.33.1",
"@metamask/sdk-communication-layer": "0.33.1",
"postcss": "8.5.26",
"sharp": "0.35.3",
"sharp": "0.35.4",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] This override is still security-load-bearing, and the new prose around it now reads as if it isn't. Next's declared range (^0.34.3 || ^0.35.4) admits 0.34.x, which is inside GHSA-rgj7-g3m4-5g8c (<0.35.4), so loosening or dropping this pin re-introduces a high finding in the generated app's audit and turns the smoke red again. Consider a short note here — or in the next.config.mjs comment — recording 0.35.4 as the advisory floor, so a future maintainer reading "that is now a template choice, not a security constraint" doesn't conclude the override is optional.

"use-sync-external-store": "1.6.0",
"uuid": "11.1.1",
"ws": "8.21.3"
Expand Down
Loading