Skip to content

fix(deps): sharp を override で 0.35.4 に上げ、dead な uuid override を外す - #308

Merged
shinyaoguri merged 1 commit into
mainfrom
fix/deps-hygiene
Sep 9, 2026
Merged

fix(deps): sharp を override で 0.35.4 に上げ、dead な uuid override を外す#308
shinyaoguri merged 1 commit into
mainfrom
fix/deps-hygiene

Conversation

@shinyaoguri

Copy link
Copy Markdown
Owner

Summary

Dependabot Updates の security update (npm_and_yarn in /. for sharp) が failure し続けていた件を、root の overrides で塞ぐ。あわせて dead になっていた uuid override を外す。

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 が唯一の手段になる。#259undici に対して行ったのとまったく同じパターンの二例目。

typedcode@1.1.0
`-- wrangler@4.127.1 (dev)
  `-- miniflare@5.20260828.0-alpha
    `-- sharp@0.35.2   <- exact pin

影響度: 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/srcIMAGES の参照も無いため、インストールされるだけで実行されない。実行時のリスクではなく衛生の問題 (high alert が open のまま、Dependabot Updates が毎回赤、npm audit が赤)。

変更点:

残る override のうち dompurify は live で必須 (monaco-editor@0.56.0 の exact 3.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 sharpwrangler@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 skip
  • npm 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 件 pass

Documentation impact

  • 上記いずれも該当なし (依存の解決版のみの変更で、不変条件・公開仕様・環境変数に影響しない)

ADR (該当する場合)

  • N/A

Related issues / PRs

Closes #307

## 目的

`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>
@shinyaoguri shinyaoguri added the security セキュリティ (XSS/DoS/偽造等) label Sep 9, 2026
@github-actions github-actions Bot added the pkg:repo リポジトリ横断 (docs/CI/依存) label Sep 9, 2026
@shinyaoguri
shinyaoguri enabled auto-merge (squash) September 9, 2026 17:11
@shinyaoguri
shinyaoguri merged commit f502a29 into main Sep 9, 2026
8 checks passed
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Name URL
Preview https://fff44e71.typedcode.pages.dev

Deployed from commit 6785237
API: staging Workers

@shinyaoguri
shinyaoguri deleted the fix/deps-hygiene branch September 9, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:repo リポジトリ横断 (docs/CI/依存) security セキュリティ (XSS/DoS/偽造等)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(deps): sharp の high 脆弱性 (GHSA-rgj7-g3m4-5g8c) を override で塞ぐ — miniflare が exact pin していて dependabot が解けない

1 participant