Skip to content

Firebase CLI の開発依存にある moderate の脆弱性を解消する (firebase-tools 15.30.0・qs 6.16.0) - #72

Merged
bannzai merged 4 commits into
mainfrom
issue-67
Sep 12, 2026
Merged

bannzai merged 4 commits into
mainfrom
issue-67

Conversation

@bannzai

@bannzai bannzai commented Sep 12, 2026

Copy link
Copy Markdown
Owner

概要

#63 の点検で見つかった firebase/functionsnpm audit の moderate (firebase-tools の推移依存) のうち、互換性を保ったまま解消できる qs 系を firebase-tools 15.30.0 への更新で解消し、修正版が未提供の残件は理由・影響範囲・再確認条件を documents/npm-audit.md に記録した。本番依存 (--omit=dev) は前後とも検出 0。

Closes #67

変更点

  • firebase/functions/package.json / package-lock.json
    • firebase-tools ^15.28.2^15.30.0 (最新)
    • firebase-tools 配下の body-parser を 1.20.6 → 1.20.8 (qs ~6.16.0) に更新 (宣言範囲内の npm update)
    • express 4.22.2 だけが qs ~6.15.1 を固定しているため、overrides"express@4": { "qs": "^6.16.0" } を追加。semver-minor の互換更新で、express 4.x 側も同じ更新 (qs ~6.16.0) を 4.22.3 として準備中 ( 4.22.3 expressjs/express#7466 )。4.22.3 が firebase-tools に解決されたら削除する
    • 強制更新 (npm audit fix --force = firebase-tools 10.1.1 へのダウングレード) は行っていない
  • Makefile / .github/workflows/functions-deploy.yml / documents/revenuecat-webhook.md: 別途インストールする Firebase CLI の固定バージョンを 15.28.2 → 15.30.0 に揃えた
  • documents/npm-audit.md (新規): 残件 3 系統の記録と再確認条件

audit の結果 (対象コミット: main の 41f8379 → 本 PR)

対象 変更前 変更後
全依存 (npm audit) moderate 8 (exit 1) moderate 5 (exit 1)
本番依存 (npm audit --omit=dev) 0 (exit 0) 0 (exit 0)

解消: qs ( GHSA-x5fp-wj9c-mxmx / GHSA-4mjr-xmp4-gh2g ) とその経路の body-parser / express@4。npm ls qs --all で全経路が 6.16.0 になったことを確認した。

残件 (すべて firebase-tools の推移依存。詳細は documents/npm-audit.md):

パッケージ 修正版 firebase-tools 15.30.0 の宣言 解消できない理由 このプロジェクトでの到達可能性
stream-json ( GHSA-528h-pc64-c93x ) 3.5.0 ^1.7.3 3.x は subpath export が変わり、override すると stream-json/filters/Pick 等の require が壊れる (上流 firebase/firebase-tools#11036 で実証) auth:import / database:import / Next.js 連携のみ。本プロジェクトは使わない
csv-parse ( GHSA-8cw4-87c7-c6xx ) 7.0.2 ^5.0.4 2 メジャー先で上流の更新待ち (同 issue 11036 で報告済み) auth:import の CSV 読み込みのみで、parse() をオプション無しで呼ぶため advisory の前提 (columns オプション) を満たさない
@opentelemetry/core ( GHSA-8988-4f7v-96qf 、経路 @google-cloud/pubsub 5.x) 2.8.0 pubsub ^5.2.0 pubsub 5 → 6 はメジャー更新で上流の更新待ち Pub/Sub エミュレータのみ。本プロジェクトは Firestore / Auth / Functions のエミュレータだけを使う

上流の firebase-tools maintainer は issue 11036 で「次のリリースで修正する見込み」と回答している (2026-09-10)。再確認の条件 (firebase-tools の宣言範囲が更新された時、express 4.22.3 が解決された時、severity 引き上げや到達可能性の前提が崩れた時) は documents/npm-audit.md に書いた。

overrides は CI と make deploy-functions が別途インストールするグローバルの firebase-tools には効かないため、そちらの express 4 内の qs は 6.15.3 のまま。この qs はエミュレータ・ローカル HTTP サーバーの query 解析にだけ使われ、デプロイ処理では外部入力を受けない。

検証

すべて本 PR の変更を含むツリーで実行し、ログは ./tmp/ に保存して全文を warning / error で検査した (該当 0 件)。

コマンド 結果
npm --prefix firebase/functions ci (lockfile の再現) exit 0
npm run typecheck exit 0
npm run lint exit 0
npm run build exit 0
make test-functions (Firestore / Auth エミュレータ上の vitest) exit 0、Test Files 6 passed、Tests 123 passed
npm audit --omit=dev 検出 0、exit 0

未検証: 更新した firebase-tools 15.30.0 での本番デプロイ (functions-deploy.yml) は #58 で行う。エミュレータ (firebase emulators:exec) は 15.30.0 で起動してテストを通した。

Codex ローカルレビュー

人間が確認

なし

セッション再開

cd /Users/bannzai/worktrees/bannzai/Alarmify/issue-67
claude --resume 22657054-420b-4123-bd16-827196f76021

npm audit (#63 の点検) で firebase-tools の推移依存に moderate が 8 件あった。
うち qs (GHSA-x5fp-wj9c-mxmx / GHSA-4mjr-xmp4-gh2g) は次で解消する。

- firebase-tools ^15.28.2 -> ^15.30.0
- firebase-tools 配下の body-parser を 1.20.6 -> 1.20.8 (qs ~6.16.0) に更新
- express 4.22.2 だけが qs ~6.15.1 を固定しているため、overrides に
  "express@4": { "qs": "^6.16.0" } を追加 (semver-minor の互換更新。
  express 4.22.3 が同じ更新を準備中 expressjs/express#7466 )

残る csv-parse / stream-json / @opentelemetry/core は firebase-tools の
宣言範囲に修正版が無く、override すると CLI が壊れる
( firebase/firebase-tools#11036 ) ため上流の更新を待つ。
本番依存 (--omit=dev) は前後とも検出 0。
Makefile (make deploy-functions)・functions-deploy.yml (CI のグローバル install)・
revenuecat-webhook.md の手順の firebase-tools を、package.json と同じ 15.30.0 にする。
firebase-tools 15.30.0 で解消できない csv-parse / stream-json /
@opentelemetry/core (pubsub 5 経由) について、advisory・修正版・
解消できない理由・このプロジェクトでの到達可能性・上流の状況と、
firebase-tools を再更新して audit をやり直す条件を残す。
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 58f22cef-f03c-4d56-b572-d1668c75d60d

📥 Commits

Reviewing files that changed from the base of the PR and between 41f8379 and f8e2c20.

⛔ Files ignored due to path filters (1)
  • firebase/functions/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/functions-deploy.yml
  • Makefile
  • documents/npm-audit.md
  • documents/revenuecat-webhook.md
  • firebase/functions/package.json

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.

@bannzai
bannzai merged commit 77fd31f into main Sep 12, 2026
5 checks passed
@bannzai
bannzai deleted the issue-67 branch September 12, 2026 12:22
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.

Firebase CLI の開発依存にある moderate の脆弱性を解消する

1 participant