Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

fix(security): remediate critical dependencies - #1

Closed
Nicolas0315 wants to merge 1 commit into
mainfrom
security/critical-remediation-20261004
Closed

Nicolas0315 wants to merge 1 commit into
mainfrom
security/critical-remediation-20261004

Conversation

@Nicolas0315

Copy link
Copy Markdown
Owner

tar6依存4辺を7.5.22へ限定更新。供給元のtrust policyは維持。

検証: frozen install、親のextract API、bounded圧縮率拒否、型検査、CLI build/publint通過。既存料金テスト10件失敗・format/AGENTS symlink不良を変更前でも再現。

実サービスへのdeployはこのPRの対象外。最新headに対するCI・レビュー・未解決会話・マージゲートを確認してから統合する。

Copilot AI balanced review requested due to automatic review settings October 4, 2026 09:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T09:19:26.688105Z fa24a91 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

ccusage performance comparison

This compares the PR build against the base branch build on the same CI runner.

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Runtime: package ccusage bin from apps/ccusage/package.json through bun -b, --offline --json, measured by hyperfine with 2 warmups and 7 runs.

Command Input Base median PR median PR vs base Base throughput PR throughput
claude daily --offline --json 0.00 MiB 50.7ms 50.2ms 1.01x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 50.8ms 50.8ms 1.00x 0.03 MiB/s 0.03 MiB/s
codex daily --offline --json 0.00 MiB 50.9ms 50.2ms 1.01x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 50.6ms 51.3ms 0.99x 0.02 MiB/s 0.02 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Runtime: package ccusage bin from apps/ccusage/package.json through bun -b, --offline --json, measured by hyperfine with 0 warmups and 1 runs.

Command Input Base median PR median PR vs base Base throughput PR throughput
claude --offline --json 1.01 GiB 1.338s 1.331s 1.00x 770.67 MiB/s 774.33 MiB/s
codex --offline --json 1.01 GiB 1.552s 1.602s 0.97x 664.08 MiB/s 643.55 MiB/s

Package size

Package artifact Base PR Delta Ratio
packed ccusage-*.tgz 70.70 KiB 70.70 KiB +0.00 KiB 1.00x

Lower medians and smaller packed package sizes are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The focused override and lockfile changes consistently remediate all affected dependency edges.

Review effort: Balanced
Findings: None

What changed in this PR

Remediates the tar archive-expansion vulnerability while preserving existing supply-chain policies.

Changes:

  • Overrides tar 6 dependencies with tar 7.5.22.
  • Updates all four dependency edges and required transitive packages.
File Description
pnpm-workspace.yaml Adds the security override.
pnpm-lock.yaml Records updated dependency resolutions.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Nicolas0315 Nicolas0315 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

レビュー(head fa24a91、コメントのみ)

差分は pnpm-workspace.yaml の override と、それに伴う pnpm-lock.yaml の更新だけです。結論として、方向性は妥当でブロッカーはありません。ただし、CI が赤いまま統合できる状態ではありません。

指摘

  • [Info] advisory と修正版は正しい: GHSA-23hp-3jrh-7fpw(CVE-2026-59873, critical)の影響範囲は tar <=7.5.18 です。7.5.22 は現時点の npm latest で、GitHub Advisory DB 上も既知の脆弱性はありません。tar 6.2.1 に残っていた GHSA-8qq5 / 34x7 / 83g3 などのパストラバーサル系もまとめて解消されます。lockfile 内の tar は 7.5.22 の1つだけになり、4つの依存辺(cacache / giget@1.2.5 / node-gyp@8.4.1 / sqlite3@5.1.7)すべてで置き換わっています。
  • [Low] 影響範囲は開発時の依存だけ: tar を取り込む経路は @praha/byethrow-docs → sqlite3 と c12 → giget@1 で、どちらも docs と devDependencies 側です。配布される ccusage パッケージのランタイムには入りません。critical というラベルに対して、実際のリスクは開発環境と CI に限られます。PR 本文にこの点を明記してください。
  • [Low] メジャーバージョンを越える override: tar@>=6 <7 → 7.5.22 は 6 から 7 への強制です。giget の extract は本文で検証済みとのことですが、node-gyp@8.4.1(sqlite3 の prebuild が取れないときのソースビルド経路)での tar.x ストリーム利用は検証されていません。prebuild が無い環境で pnpm install が通るかを一度確認することを推奨します。
  • [Nit] lockfile に孤立エントリが残っている: minipass@5.0.0 は tar 6 だけが参照していたため、今は参照元がありません。pnpm install(または pnpm dedupe)で再生成して取り除くのが望ましいです。
  • [Info] override のコメント: GHSA-23hp だけを挙げていますが、他の tar 6 の advisory にも効くので、「tar <7.5.21 の既知 advisory 群」と書くほうが実態に合います。

CI 失敗の原因(どれもこの PR の差分に起因しないと判断)

  • npm-publish-dry-run-and-upload-pkg-pr-now: The app https://github.com/apps/pkg-pr-new is not installed on or does not have access to Nicolas0315/ccusage(404)。fork 環境が原因で、pkg-pr-new App が未インストールです。
  • schema-check: 生成したスキーマと commit 済みの config-schema.json の差分で失敗しています。差分は remoteHost / remoteTailscale / remoteTmp で、fork の main にある独自コミット(feat(remote)…)がスキーマを再生成していないためです。fork の base が原因で、tar とは無関係です。
  • test: src/adapter/claude/data-loader.ts の料金計算テストが10件失敗しています(expected 0 to be greater than 0)。依存の変更はランタイムに影響しないので、本文の記載どおり変更前から失敗していたものと判断します。ただし fork の main では push 時の CI が走っておらず、CI 上で base と比較した記録はありません。

upstream との関係

  • upstream(ccusage/ccusage)の main は fork より1593コミット先行しています。その lockfile には tar・sqlite3・byethrow-docs 系がもう存在しないため、upstream では依存の削除で解消済みです。この PR を upstream に出す必要はありません。

推奨

fork を当面使うなら、この PR はこのままで問題ありません。ただし、根本的には fork の main を upstream に追従させる(独自の remote 機能は rebase し、スキーマも再生成する)ほうが効果が大きいです。マージの前に、少なくとも schema-check と test が fork の base でも失敗することを CI 上で示してください。

@Nicolas0315

Copy link
Copy Markdown
Owner Author

リポジトリがアーカイブ済みでマージできないため、未マージのまま閉じます。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants