fix(deps): next 配下の postcss を override し脆弱性アラートの原因を除去 - #730
Merged
Conversation
next@16.2.12 が postcss を exact pin (8.4.31) で引き込むため、直接依存の postcss@8.5.23 と併存し、8.4.31 側に OPEN な脆弱性アラートが 3 件残っていた。 - GHSA-qx2v-qp2m-jg93 (medium): </style> 未エスケープによる XSS - GHSA-6g55-p6wh-862q (high): sourceMappingURL 経由の任意ファイル読み取り - GHSA-r28c-9q8g-f849 (high): source map 自動読み込みのパストラバーサル 直接依存を上げても next 配下は動かないため、Dependabot security update が postcss の新リリース毎に解決しない PR を作り続けていた (#727 / #729)。それらは security update ゆえ dependabot.yml の ignore / cooldown を無視して公開直後に 立つため、pnpm の minimumReleaseAge (24h) ゲートで CI が必ず落ちる状態だった。 ## override の範囲を next 配下に限定する理由 `next>postcss` セレクタで next 配下のみを対象にする。素の `postcss` 指定は全 consumer に及ぶが、8.4.31 を引き込んでいるのは next だけなので、影響範囲を実際の 問題箇所に一致させる。値は直接依存と同じ `^8.5.23` とし、postcss が lockfile 上 1 バージョンに畳まれた状態を維持する。 pnpm 11 は package.json の pnpm フィールドを読まないため pnpm-workspace.yaml に 記述する。next が pin を上げたらこの override は不要になる。 ## 確認済み - lockfile: postcss@8.4.31 のエントリが消え 8.5.23 単一に。他パッケージに差分なし - 24h ゲート内の postcss@8.5.24 は混入せず (minimumReleaseAge が解決時に除外) - pnpm i --frozen-lockfile: exit 0 - mise run check-versions: pnpm 版一致 11.17.0 - eslint .: exit 0 - vitest --run: 5 files / 14 tests pass - next build: exit 0 (TypeScript 検査・静的ページ 3 件生成まで完走、警告なし) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014MRnn98gA2cbVajJqkgw5E
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changes依存関係更新
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
期待する挙動・状態
application/pnpm-lock.yamlからpostcss@8.4.31が消え、postcss が8.5.23単一に畳まれる</style>未エスケープによる XSSsourceMappingURL経由の任意ファイル読み取り背景
next@16.2.12が postcss を exact pin (8.4.31) で引き込むため、直接依存のpostcss@8.5.23と併存し、8.4.31 側にアラートが残り続けていた。直接依存を上げても next 配下は動かないため、Dependabot security update が無効な PR を作り続けていた。それらは security update ゆえdependabot.ymlのignore/cooldownを無視して公開直後に立つため、pnpm のminimumReleaseAge(24h) ゲートで CI が必ず落ちる状態でもあった。確認済み項目
pnpm i --frozen-lockfile: exit 0mise run check-versions: pnpm 版一致 11.17.0eslint .: exit 0vitest --run: 5 files / 14 tests passnext build: exit 0 (TypeScript 検査・静的ページ 3 件生成まで完走、警告なし)pnpm build-storybook: exit 0 (Chromatic 経路)postcss@8.5.24が混入していないこと (minimumReleaseAgeが解決時に除外)見てほしいところ
next>postcssに限定した判断: 素のpostcss:指定は全 consumer に及ぶが、8.4.31 を引き込んでいるのは next のみなので親を限定した。将来 next 以外が古い postcss を引き込んだ場合は検知されず素通りするトレードオフがある^8.5.23(レンジ) にした判断: 直接依存の specifier と揃えることで postcss が lockfile 上 1 ノードに畳まれた状態を維持できる。exact 固定にすると将来また 2 ノードに割れるpnpm-workspace.yamlに置いた判断: pnpm 11 はpackage.jsonのpnpmフィールドを読まないため workspace yaml 側が唯一の選択肢という理解Summary by CodeRabbit