fix(deps): undici を override で 7.29.0 に上げ、dead な rollup override を外す - #259
Merged
Conversation
## 目的 Dependabot の security update (undici) が failure で終わり続けていた。原因は 自動更新の詰まりで、放置すると脆弱性が残る。 `wrangler 4.115.0` → `miniflare 4.20260722.1` → `undici 7.28.0` の経路で 脆弱な undici が入るが、Dependabot が見つけた唯一の更新パスが wrangler を 4.115.0 → 4.35.0 へ**ダウングレード**するものだったため、自ら中止していた。 wrangler を上げても解決しない: 最新の 4.119.0 が要求する `miniflare 5.20260801.0-alpha` も undici を `7.28.0` で固定している。 そのため Dependabot 自身が提示するもう一方の案 (override による pin) を採る。 対象は 5 件 (GHSA-4cwx-7wf7-3272 high / 他 medium 4)。いずれも `scope: development` で、undici は wrangler・miniflare のローカル開発サーバと デプロイ用ツールにしか入らない (Cloudflare Workers の本番ランタイムには 配布されない)。影響範囲はローカルの `wrangler dev` と CI の e2e 環境。 ## 変更点 - root `package.json` の `overrides` に `"undici": "^7.29.0"` を追加。 このリポは既に vite / dompurify / ws / uuid で同じ手を使っており、その延長 - `overrides` から `"rollup": "^4.59.0"` を削除。#256 で editor から `vite-plugin-top-level-await` (と、そのためだけの rollup 依存) を落とした 結果、lockfile 上の rollup エントリは 0 件・依存元も 0 件で dead になった - `package-lock.json` は undici 7.28.0 → 7.29.0 の 3 行のみ (他のバージョン 変動・パッケージの増減なし) ## 確認方法 - `npm install` 後、`node_modules/undici` が **7.29.0** に解決されること、 `npm audit` が `found 0 vulnerabilities` を返すことを確認 - rollup が lockfile に復活していないこと (エントリ 0 件) を確認 - `npm run lint` exit 0 / `npm run typecheck` exit 0 - ユニットテスト 608 passed / 3 skipped (全 workspace) - `npm run build` exit 0 - **`npm run test -w @typedcode/e2e` 17 passed** — miniflare は undici を `7.28.0` で厳密指定しているため未テストの組み合わせになる。実際に `wrangler dev` を起動する e2e が通ることをこの override の可否の判断材料に した - `npm run test:build -w @typedcode/e2e` 1 passed (本番ビルドのスモーク) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
🚀 Preview Deployment
Deployed from commit 40d0486 |
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.
目的
Dependabot の security update (undici) が failure で終わり続けていた。自動更新が詰まっており、放置すると脆弱性が残る。
原因は依存の経路にある:
パッチ版は
7.29.0だが、Dependabot が見つけた唯一の更新パスが wrangler を 4.115.0 → 4.35.0 へダウングレードするものだったため、自ら中止していた。wrangler を上げても解決しない。 最新の 4.119.0 が要求する
miniflare 5.20260801.0-alphaも undici を7.28.0で固定している (確認済み)。そのため Dependabot 自身が提示するもう一方の案 — override による pin — を採る。影響度
対象は 5 件 (
GHSA-4cwx-7wf7-3272high / 他 medium 4)。いずれもscope: developmentで、lockfile 上もdev=trueの 1 エントリのみ。undici は wrangler・miniflare のローカル開発サーバとデプロイ用ツールにしか入っておらず、Cloudflare Workers の本番ランタイムには配布されない (Workers は自前の fetch 実装を使う)。実際の影響範囲はローカルのwrangler devと CI の e2e 環境。変更点
package.jsonのoverridesに"undici": "^7.29.0"を追加vite/dompurify/ws/uuidで同じ手を使っており、その延長overridesから"rollup": "^4.59.0"を削除vite-plugin-top-level-await(と、そのためだけの rollup 依存) を落とした結果、lockfile 上の rollup エントリは 0 件・依存元も 0 件で dead になったpackage-lock.jsonは undici 7.28.0 → 7.29.0 の 3 行のみ。他のバージョン変動・パッケージの増減なし確認方法
node_modules/undiciの解決先npm auditnpm run lintnpm run typechecknpm run buildnpm run test -w @typedcode/e2enpm run test:build -w @typedcode/e2ee2e が本命の検証。 miniflare は undici を
7.28.0で厳密指定しているため、7.29.0 への差し替えは未テストの組み合わせになる。実際にwrangler dev(= miniflare) を起動する e2e が通ることを、この override を入れてよいかの判断材料にした。残る懸念
miniflare 側が undici を上げるまで、この override は「上流が想定していない組み合わせ」であり続ける。壊れた場合は e2e が CI で落ちるので気付ける。上流が追いついたら override を外せる。
🤖 Generated with Claude Code