Skip to content

fix: security vulnerabilities and Node.js version alignment - #557

Merged
keito4 merged 3 commits into
mainfrom
fix/security-vulnerabilities
Mar 9, 2026
Merged

fix: security vulnerabilities and Node.js version alignment#557
keito4 merged 3 commits into
mainfrom
fix/security-vulnerabilities

Conversation

@keito4

@keito4 keito4 commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • セキュリティ脆弱性への対応と Node.js バージョンの整合性確保
  • npm 内部のバンドル依存は override できないため、.trivyignore に記載

Changes

  • .trivyignore: CVE-2026-29786 (tar) と CVE-2026-27903 (minimatch) を追加
  • package.json: engines フィールドを追加、tar override のみ残す
  • .node-version: 22.22.0 に更新(Dockerfile と整合)
  • package-lock.json: 同期

対応できない脆弱性

CVE パッケージ 理由
CVE-2026-29786 tar@7.5.9 npm 内部のバンドル依存
CVE-2026-27903 minimatch@10.2.2 npm 内部のバンドル依存

これらは npm upstream の修正待ちです。

Test plan

  • ローカルテスト全て通過
  • CI Unit Tests 成功
  • CI Lint & Format 成功
  • CI Integration Tests 成功
  • NPM Audit 成功
  • License Compliance 成功

🤖 Generated with Claude Code

- Add overrides for tar@7.5.11 and minimatch@10.2.4
- Document tar/minimatch CVEs in .trivyignore (bundled in npm, cannot override)
- Add engines field requiring Node.js ^22.14.0 || >= 24.10.0
- Update .node-version to 22.22.0 (matching Dockerfile)

CVE-2026-29786: tar Hardlink Path Traversal
CVE-2026-27903: minimatch ReDoS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Bumps Node runtime to 22.22.0, adds two CVE ignore entries for tar and minimatch in .trivyignore, and updates package.json to add engines.node and change dependency overrides (remove overrides.npm.tar, add overrides.tar).

Changes

Cohort / File(s) Summary
Node runtime file
.node-version
Updated Node.js version from 22.14.0 to 22.22.0.
Package manifest
package.json
Added `engines.node: "^22.14.0
Vulnerability ignores
.trivyignore
Added entries for CVE-2026-29786 (tar) and CVE-2026-27903 (minimatch) with metadata and trailing CVE lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

size/S

Poem

🐰 A quick hop, a tiny bump in place,
Node's new shoes with a faster pace,
CVEs tucked into a safety nest,
Overrides set so builds can rest,
I nibble carrots, then applaud this chase.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: security vulnerability fixes (CVE entries in .trivyignore, tar override) and Node.js version alignment across .node-version, package.json engines field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/security-vulnerabilities

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@keito4

keito4 commented Mar 9, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項(重大度順)

  • セキュリティ: package.json に tar/minimatch の override を追加していますが、package-lock.json では依然として npm が tar@^7.5.9minimatch@^10.2.2 を参照しており、意図した脆弱性修正が反映されていません。結果として CVE 対応が無効のままになります。package.json:49-51package-lock.json:6820-6844

判定: patch is incorrect
理由: 追加した override がロックファイル上の依存解決に反映されておらず、脆弱性是正の意図が満たされていないため。
信頼度: 0.56

✨ Gemini Review

MCP server 'supabase' requires authentication using: /mcp auth supabaseMCP server 'vercel' requires authentication using: /mcp auth vercel## コードレビュー

問題点

  1. 脆弱性対応の矛盾
    • ファイル: .trivyignore (行 60-84), package.json (行 51-54)
    • 説明: package.jsonoverridesを使いtarminimatchの脆弱性を修正しようとしている一方で、.trivyignoreでは同じ脆弱性を「オーバーライドできない」という理由で無視リストに追加しています。この2つの対応は矛盾しており、保守性を低下させます。
    • @semantic-release/npmが依存するnpmパッケージは、これらの依存関係をbundleDependenciesとして含んでいるため、overridesが機能しない可能性が高いです。もしoverridesが機能していないのであれば、誤解を招くためpackage.jsonの該当箇所を削除し、.trivyignoreでの対応に統一してください。もし機能しているのであれば、.trivyignoreへの追加は不要です。

総合評価

patch is incorrect

  • 理由: 脆弱性への対応方針に矛盾が含まれており、package.jsonに加えられたoverridesの変更は意図通りに機能していない可能性が高いです。このままでは、将来のメンテナンス時に混乱を招く原因となります。
  • 信頼度: 0.9

⚠️ 修正が必要です

上記のレビューで問題が指摘されています。修正してからマージしてください。


🤖 Generated by post_pr_ai_review.py hook

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0ab951942

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json Outdated
"tar": "7.5.7"
}
"tar": "^7.5.11",
"minimatch": "^10.2.4"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Scope minimatch override to avoid invalid dependency graph

The new top-level minimatch override forces every consumer to ^10.2.4, including packages that declare incompatible majors; in this lockfile glob still declares ^9.0.4 (package-lock.json:4682) and test-exclude declares ^3.x (package-lock.json:10579, :10596), and npm ls minimatch now reports ELSPROBLEMS with invalid dependencies. This can break repo tooling that relies on a healthy npm list result (for example script/dependency-health-check.sh:64), so the override should be narrowed to the vulnerable path rather than applied globally.

Useful? React with 👍 / 👎.

minimatch@10.x exports `{ minimatch }` as a named export instead of
a function, which breaks packages like test-exclude that use
`require('minimatch')` expecting a function.

The minimatch CVE is documented in .trivyignore since it's a bundled
dependency in npm that cannot be overridden.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@keito4

keito4 commented Mar 9, 2026

Copy link
Copy Markdown
Owner Author

(aside)
@claude PRがbaseにマージする際にCIが落ちています。
修正してください。

@claude

claude Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 7m 8s —— View job


CI修正完了 ✅

原因: minimatch override を追加・削除した際に package-lock.json が再生成されず、globtest-exclude が必要とする以下のパッケージが欠落していた。

欠落していたパッケージ 必要としていたパッケージ
minimatch@9.0.9 glob
minimatch@3.1.5 test-exclude
brace-expansion@2.0.2 glob/minimatch
brace-expansion@1.1.12 test-exclude/minimatch
balanced-match@1.0.2 上記 brace-expansion
concat-map@0.0.1 test-exclude/brace-expansion

修正内容 (commit e115201):

  • npm install --package-lock-only --ignore-scriptspackage-lock.json を再生成

  • 71 行が追加され、欠落していたパッケージエントリが復元された

  • CI失敗状況の確認 (npm ci がロックファイルと package.json の不整合で失敗)

  • npm install でロックファイルを再生成

  • コミット・プッシュ済み (e115201)
    | Branch: fix/security-vulnerabilities

Sync lock file with package.json changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude

claude Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

コードレビュー

全体的に丁寧にまとめられた PR です。以下にいくつかの指摘事項を挙げます。


要確認: PR サマリーと実際の差分の不一致

PR 説明文には「Add npm overrides for tar@7.5.11 and minimatch@10.2.4」とありますが、実際の diff には minimatch の override が含まれていません。意図的に除外したのか、うっかり抜けたのかを確認してください。


override の有効性と .trivyignore の矛盾

PR 本文では「バンドル依存関係は npm overrides で上書きできない」と説明しつつ、overrides に tar: ^7.5.11 を残しています。

  • 旧: { "npm": { "tar": "7.5.7" } } → npm の内部 tar を対象にした記述
  • 新: { "tar": "^7.5.11" } → 全依存ツリーの tar を対象にした記述

npm がバンドルする tar/minimatch はロックファイルで管理されないため、overrides でも上書きできません。.trivyignore でのドキュメント化は適切ですが、無効な override エントリを残すと混乱を招く可能性があります。この override が semantic-release 以外の依存パス(tar を直接使う他のパッケージ)を保護する意図であるなら、コメントで明示することを推奨します。


engines フィールドのスタイル

package.json の engines フィールドにスペースの揺れがあります(機能的な問題はなし)。

  • 現状: "node": "^22.14.0 || >= 24.10.0"
  • 推奨: "node": "^22.14.0 || >=24.10.0"

良い点

  • .trivyignore のドキュメントが充実(CVE ID・重大度・影響パッケージ・修正バージョン・理由・追跡 URL・レビュー日)
  • .node-version を Dockerfile の 22.22.0 に合わせた整合性確保
  • flatted の 3.4.0 → 3.4.1 マイナーバグフィックス更新
  • レビュー日(2026-04-09)の明示により定期確認の仕組みが維持されている

総評

セキュリティ対応の意図は明確で、暫定対処(.trivyignore ドキュメント化)と恒久対処(npm 側のアップデート待ち)の区別もできています。上記の「minimatch override の欠落」と「無効 override の残留」について確認・修正をお願いします。

🤖 Reviewed by Claude Sonnet 4.6

@keito4
keito4 merged commit 9a2e9c4 into main Mar 9, 2026
16 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.93.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant