fix(deps): sharp を override で 0.35.4 に上げ、dead な uuid override を外す - #308
Merged
Conversation
## 目的
`Dependabot Updates` の security update (`npm_and_yarn in /. for sharp`) が
failure し続けていた。依存経路は次のとおり:
typedcode@1.1.0
`-- wrangler@4.127.1 (dev)
`-- miniflare@5.20260828.0-alpha
`-- sharp@0.35.2 <- exact pin
miniflare が sharp を範囲ではなく exact `0.35.2` で要求しているため、dependabot は
脆弱版から動かせない。最新の `miniflare@5.20260908.0-alpha` も同じ pin なので、
wrangler / miniflare を上げても解決しない (#288 で wrangler を 4.115.0 → 4.127.1 に
上げた後も alert は open のまま残っていた)。override が唯一の手段になる。
## 影響度
`GHSA-rgj7-g3m4-5g8c` (high) / sharp `< 0.35.4` / libheif の HEIF・AVIF デコード脆弱性。
scope は development で、本番 Worker には配布されない。sharp は miniflare の Images
binding ハンドラ内で動的 import されるだけだが、本リポの wrangler 設定 3 つに Images
binding は無く `packages/workers/src` に `IMAGES` の参照も無いため、インストールされる
だけで実行されない。実行時のリスクではなく衛生の問題 (high alert が open のまま、
Dependabot Updates が毎回赤、`npm audit` が赤)。
## 変更点
- overrides に `"sharp": "^0.35.4"` を追加。`0.35.2 → 0.35.4` は patch で API 互換。
miniflare の exact pin を override で外す形は #259 の undici と同じで、これが二例目
- dead になっていた `"uuid": "^11.1.1"` override を削除。唯一の依存元だった
vite-plugin-top-level-await を #256 で外した時点で dead になっており、lock に
エントリも要求元も無い (#259 は同じ原因で dead になった rollup override だけを
外し、uuid を見落としていた)
- lock の差分は sharp 本体と `@img/sharp-*` / `@img/sharp-libvips-*` の
プラットフォームバイナリ群のみ。他の依存は動いていない
- `npm audit`: high 3 件 (sharp / miniflare / wrangler) → **0 件**
残る override のうち `dompurify` は live で必須 (monaco-editor@0.56.0 の exact 3.4.8 を
上書きして 3.4.14 に載せている)。`vite` / `ws` / `undici` は現時点では冗長だが floor と
しては無害なので今回は触らない。
Assisted-by: Claude <noreply@anthropic.com>
🚀 Preview Deployment
Deployed from commit 6785237 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dependabot Updatesの security update (npm_and_yarn in /. for sharp) が failure し続けていた件を、root のoverridesで塞ぐ。あわせて dead になっていたuuidoverride を外す。miniflare が sharp を範囲ではなく exact
0.35.2で要求しているため dependabot は脆弱版から動かせず、最新のminiflare@5.20260908.0-alphaも同じ pin なので wrangler / miniflare を上げても解決しない (#288 で wrangler を 4.115.0 → 4.127.1 に上げた後も alert は open のままだった)。override が唯一の手段になる。#259 でundiciに対して行ったのとまったく同じパターンの二例目。影響度:
GHSA-rgj7-g3m4-5g8c(high) / sharp< 0.35.4/ libheif の HEIF・AVIF デコード脆弱性。scope は development で本番 Worker には配布されない。sharp は miniflare の Images binding ハンドラ内で動的 import されるだけだが、本リポの wrangler 設定 3 つに Images binding は無くpackages/workers/srcにIMAGESの参照も無いため、インストールされるだけで実行されない。実行時のリスクではなく衛生の問題 (high alert が open のまま、Dependabot Updates が毎回赤、npm auditが赤)。変更点:
overridesに"sharp": "^0.35.4"を追加 (0.35.2 → 0.35.4は patch で API 互換)"uuid": "^11.1.1"override を削除。唯一の依存元だったvite-plugin-top-level-awaitを fix(editor): vite-plugin-top-level-await を外して本番ビルドのエディタ起動を直す #256 で外した時点で dead になっており、lock に要求元もエントリも無い (fix(deps): undici を override で 7.29.0 に上げ、dead な rollup override を外す #259 は同じ原因で dead になった rollup override だけを外し、uuid を見落としていた)@img/sharp-*/@img/sharp-libvips-*のプラットフォームバイナリ群のみで、他の依存は動いていない残る override のうち
dompurifyは live で必須 (monaco-editor@0.56.0の exact3.4.8を上書きして 3.4.14 に載せている)。vite/ws/undiciは現時点では冗長だが floor としては無害なので今回は触らない。Test plan
npm ci --include=optionalでクリーンに入れ直した上で、CI の 3 ジョブに対応するコマンドを一式ローカルで実行した。npm audit— high 3 件 → 0 件 (sharp/ それを含むminiflare/wranglerがすべて消えた)npm ls sharp—wrangler@4.127.1 → miniflare@5.20260828.0-alpha → sharp@0.35.4に解決。optional なプラットフォームバイナリ (@img/sharp-*) も解決漏れなしnpm run build— 全パッケージビルド成功npm run typecheck/npm run lint— pass (lint の warning / info は既存分のみ)npm run test:run --workspaces --if-present— 820 件 pass / 3 skipnpm run deploy:staging -w @typedcode/workers -- --dry-run/ 同deploy:production— 両方成功npm run test -w @typedcode/e2e— 17 件 pass。wrangler dev (= miniflare) が実際に起動する唯一の経路で、sharp 0.35.4 入りの node_modules で正常に動くことの確認npm run test:build -w @typedcode/e2e— 1 件 passDocumentation impact
ADR (該当する場合)
Related issues / PRs
Closes #307
undiciを override で上げ、dead な rollup override を外した先例。今回はその二例目nanoid@3.3.18に解決されたことで既に解消済み (alert Bump the dev-dependencies group across 1 directory with 7 updates #58 は fixed)。この PR には含めず、Issue 側に事実を記録して close する。fix(deps): nanoid の high 脆弱性 (GHSA-2v37-7h3g-55p8) を override で塞ぐ — dependabot の自動更新が失敗し続けている #270 のトリアージが宿題として挙げていた dead override (uuid) の掃除だけをこの PR に取り込んだ