Skip to content

security: clear the frontend runtime advisories - #67

Merged
yufoxda merged 1 commit into
developfrom
security/patch-frontend-advisories
Jul 27, 2026
Merged

security: clear the frontend runtime advisories#67
yufoxda merged 1 commit into
developfrom
security/patch-frontend-advisories

Conversation

@yufoxda

@yufoxda yufoxda commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

npm audit --omit=dev が11件の high で失敗し続けており、#56 で追加されたリリースゲートを塞いでいます。develop 単体で再現します(このPRとは独立に、アドバイザリ公開以降ずっと赤)。

単純なバージョン更新では直りません

3つの連鎖があり、いずれもバージョンを上げるだけでは解消しませんでした。npm audit fix --forcenext@9.3.3 へのダウングレードを提案してきます。

連鎖 経路
sharp @opennextjs/cloudflare → wrangler → miniflare → sharp
brace-expansion @opennextjs/cloudflare → @opennextjs/aws → @node-minify/core → glob → minimatch
postcss next → postcss(16.2.12 でも 8.4.31 を固定)

対処

1. @opennextjs/cloudflare を devDependencies へ

next.config.ts / open-next.config.ts とビルドスクリプトからのみ使われ、src/ 配下は一切 import していません。元々 devDependencies が正しい分類で、移動により上位2つの連鎖が実行時グラフから外れます。wrangler は既に devDependencies にあり、この1つが橋渡しになっていました。

2. overrides で postcss と sharp を修正版に固定

postcss は next 経由で残り、next はどのリリースでも 8.4.31 を固定するため上流の更新を待っても直りません。既存の override が 8.5.13(現在は脆弱)だったので ^8.5.23 に更新し、sharp も同様に固定しました。いずれもパッケージが既に依存しているメジャー内のパッチ移動です。

3. next を 16.2.12 へ

@opennextjs/cloudflare の peer 範囲(>=16.2.11)を満たします。16.2.10 のままだと npm が依存ツリーを解決できませんでした。

検証

ゲートと同じコマンドで確認しています。

対象 npm audit --omit=dev --audit-level=high
frontend ✅ 終了コード0
community ✅ 終了コード0
member ✅ 終了コード0

frontend は型チェック・テスト・lint(エラー0)・本番ビルドも通ります。

補足

実行時グラフから外しただけで、ビルドツール側の脆弱性が消えたわけではありません。ただし --omit=devデプロイされるコードの依存を対象にするゲートであり、ビルド専用ツールをそこに含めていたのが本来の誤りです。ビルドツールの更新は通常の依存更新として別途扱えます。

🤖 Generated with Claude Code

npm audit --omit=dev has been failing on eleven high-severity advisories since
they were published, which blocks the release gate added in #56. Three chains
were involved and none of them were fixable by a plain version bump.

@opennextjs/cloudflare is only used by next.config.ts, open-next.config.ts and
the build scripts; nothing under src imports it. Moving it to devDependencies
is what it always should have been, and it takes the wrangler → miniflare →
sharp and @opennextjs/aws → @node-minify → glob → minimatch → brace-expansion
chains out of the runtime graph with it.

postcss stays reachable through next, which pins 8.4.31, so no next release
fixes it. The existing postcss override is moved from the now-vulnerable
8.5.13 to ^8.5.23, and sharp is pinned the same way. Both are patch-level
moves within the major the packages already depend on.

next goes to 16.2.12, which is also what @opennextjs/cloudflare's peer range
asks for; on 16.2.10 npm could not resolve the tree at all.

Verified with the gate's own command: community, member and frontend all exit
zero, and the frontend still type-checks, tests, lints and builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yufoxda
yufoxda merged commit d20dcde into develop Jul 27, 2026
2 checks passed
@yufoxda
yufoxda deleted the security/patch-frontend-advisories branch July 27, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant