fix(create-sei): clear the new Next.js and sharp advisories - #351
fix(create-sei): clear the new Next.js and sharp advisories#351alexander-sei wants to merge 2 commits into
Conversation
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 next >=13.4.0 <15.5.24 GHSA-2xp9-vwfh-vxw4 critical next >=10.0.0 <15.5.24 GHSA-rgj7-g3m4-5g8c high sharp <0.35.4 Both pins move inside their minor: next 15.5.21 to 15.5.25, and the sharp override 0.35.3 to 0.35.4. Next 15.5.25 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 asserted the opposite, so they are corrected: images stay unoptimized to avoid requiring a native Sharp build, which is a template choice rather than a security tradeoff. The remaining decode-uri-component finding is moderate and does not block. Co-authored-by: Cursor <cursoragent@cursor.com>
PR SummaryLow Risk Overview README and Reviewed by Cursor Bugbot for commit 340b963. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #351 +/- ##
=======================================
Coverage 97.17% 97.17%
=======================================
Files 80 80
Lines 5410 5410
=======================================
Hits 5257 5257
Misses 153 153
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
A tightly scoped, well-documented advisory fix: next 15.5.21→15.5.25 and the sharp override 0.35.3→0.35.4 both clear the cited GHSAs inside their pinned minors, stale image-handling notes are corrected, and a correctly scoped patch changeset is included. No blockers; my notes are documentation durability, one safeguard against a future maintainer dropping the still-security-relevant sharp pin, and a couple of process observations.
Findings: 0 blocking | 8 non-blocking | 2 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- The Cursor second-opinion file (
cursor-review.md) is empty — that pass produced no output, so this review reflects only the Codex pass ("no material issues found") and my own read. - I could not independently verify the upstream claims in this PR from this environment (no npm registry access): that
next@15.5.25exists, that it declaressharpas^0.34.3 || ^0.35.4, and thatsharp@0.35.4is the fixed release. The claims are internally consistent with the cited advisory ranges (next <15.5.24,sharp <0.35.4), andcreate-sei-smoke.ymltriggers onpackages/create-sei/**so the install + audit + production build on this PR is the authoritative check — confirm that run is green before merge. - Root cause is unaddressed by design, worth a follow-up:
create-sei-smoke.ymlhas onlypull_requestandworkflow_dispatchtriggers, so advisories published against the template's exact pins first surface as a red check on an unrelated PR (as the description notes). Aschedule:cron running the audit against the template pins would surface drift on its own PR instead. Out of scope here. - Adjacent, not this PR's diff: the root
bun.lockstill resolvessharp@0.35.0(via@dynamic-labs/iconic,bun.lock:1057), inside the sameGHSA-rgj7-g3m4-5g8crange. Companion PR #350 handles that path with consumer-facing README overrides only, so the workspace's own dev tree stays on 0.35.0 — worth confirming that is intentional (build-time icon tooling, never bundled) rather than an oversight. - Changeset present and correctly scoped (
@sei-js/create-sei, patch). Template-only changes generally don't need one per the repo guidelines, but the pins ship inside the published package, so including it is right. - No prompt-injection or instruction-like content found in the diff, commit message, or PR description.
- 2 suggestion(s)/nit(s) flagged inline on specific lines.
| "@metamask/sdk-communication-layer": "0.33.1", | ||
| "postcss": "8.5.26", | ||
| "sharp": "0.35.3", | ||
| "sharp": "0.35.4", |
There was a problem hiding this comment.
[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.
| ## 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. Next 15.5.25 declares Sharp `^0.34.3 || ^0.35.4`, and the manifest pins `0.35.4`, the release that clears the libheif advisory in that range, so enabling optimization is a template choice rather than a security tradeoff. |
There was a problem hiding this comment.
[nit] This paragraph hard-codes the exact patch version (Next 15.5.25), which is the same coupling that made the previous text wrong and required this PR. The dev-bundler paragraph just below was genericized in this same diff (the pinned Next 15 line); applying that treatment here — e.g. "the pinned Next 15 line declares Sharp ^0.34.3 || ^0.35.4" — keeps the note accurate across future patch bumps. Same applies to next.config.mjs:8.
The previous wording said image handling is "a template choice, not a security constraint", which reads as if the Sharp override were optional too. It is not: Next declares ^0.34.3 || ^0.35.4, and the 0.34.x half is still inside GHSA-rgj7-g3m4-5g8c, so loosening the pin reintroduces a high finding whether or not optimization is enabled. Both notes now separate the two: images stay unoptimized to avoid a native Sharp build, while 0.35.4 is the advisory floor for the override. The README also no longer names an exact Next patch version, matching the dev-bundler note. That coupling is what made the previous text wrong. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Both suggestions applied in 340b963. Sharp pin is still security-load-bearing. You're right, and my wording was the problem — it collapsed two separate things. Image optimization being off is a template choice; the override is not. Next's The README carries the same split, with the advisory linked so the floor is checkable rather than asserted. Hard-coded patch version. Genericized to "the pinned Next 15 line", matching the dev-bundler note. The only remaining exact version in the template is the Unverifiable upstream claims. Reasonable, since the review environment has no registry access. For the record, from an environment that does:
The one red check here, |
There was a problem hiding this comment.
A tightly scoped, well-documented security bump of the Next template's next and sharp pins that clears two criticals and one high, with a changeset and corrected image notes. No blocking issues; only minor documentation and verification notes.
Findings: 0 blocking | 4 non-blocking | 1 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- The Cursor second-opinion pass produced no output (
cursor-review.mdis empty), so this review reflects only my own analysis plus Codex's, which reported no material issues. - I could not independently verify the advisory ranges or that Next 15.5.25 declares Sharp
^0.34.3 || ^0.35.4— npm registry and GitHub Advisory lookups were unavailable in this environment. The version arithmetic in the PR is internally consistent (15.5.25 ≥ the 15.5.24 patch floor; 0.35.4 ≥ the 0.35.4 floor) and the author reports a localbun run test:create-sei-releasepass, so I am not treating this as a defect — just flagging that the external sources were not re-checked here. - The exact
sharpoverride means every future Sharp patch advisory needs a manual bump in this file. Sincecreate-sei-smoke.ymlhas no schedule, that drift keeps surfacing as a red check on an unrelated PR (as it did here). A scheduled run of the smoke workflow, or Dependabot coverage forpackages/create-sei/templates/**, would catch it out-of-band instead — out of scope for this PR, but worth a follow-up. - 1 suggestion(s)/nit(s) flagged inline on specific lines.
| ## 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. |
There was a problem hiding this comment.
[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.
|
Superseded by #350. Both smoke workflows include |
The
create-sei Smokecheck audits every generated variant and fails on any high or critical finding. Three advisories landed against the template's pinned versions, so the check is red on every pull request that triggers it — the last green run was Aug 31, and this workflow has no schedule, so the drift only surfaces on PRs.next>=13.4.0 <15.5.24next>=10.0.0 <15.5.24sharp<0.35.4The two criticals are unauthenticated RCE, one on Windows-hosted servers and one in the Image Optimization API when AVIF files are used.
Both pins move inside their minor:
nextfrom15.5.21to15.5.25, and thesharpoverride from0.35.3to0.35.4.Stale image notes corrected
Next 15.5.25 widened its own Sharp declaration to
^0.34.3 || ^0.35.4, so the pinned0.35.4override now sits inside the range Next supports. The template README andnext.config.mjsboth asserted the opposite — that Next "declares only vulnerable Sharp 0.34.x" and that 0.35.x used an "unsupported optimizer API" — so they are corrected.Images stay unoptimized, which keeps the generated app free of a native Sharp build. That is now a template choice rather than a security tradeoff; actually enabling optimization is a separate decision and is not made here.
Verification
bun run test:create-sei-releasepasses locally, on the same Bun 1.3.14 as CI:Both variants scaffold, install, pass
biome check, complete a Next production build, and serve a production runtime. The one remaining finding isdecode-uri-component(moderate), which does not block the smoke.Companion to #350, which clears the separate advisories in the Sei Global Wallet consumer smoke. The two touch different packages and are independent.