Skip to content
cccskills
FreePublished on GitHub

Firebase Security Rules Review

Detects over-permissive Firestore/Storage rules (allow read, write: if true / auth-only without ownership), missing auth checks on writes, and admin SDK private key exposure to client bundles.

The English summary is being prepared. Showing the original description.

Works withFirebase
See how to install

Files included (4)

  • SKILL.md3.9 KB
  • fixtures/01-allow-if-true-happy.md864 B
  • fixtures/02-public-read-intentional-guard.md1.6 KB
  • golden/01-allow-if-true-happy.md750 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: Firebase Security Rules の過剰許可と認可漏れ、機密 config 露出をチェックリスト型で検査する

Goal / 目的

  • allow read, write: if true; や request.auth != null だけの所有者チェック欠如ルールを検出し、他人のドキュメント書き換えを防ぐ。
  • allow write に request.auth 条件が無い認証チェック欠如を検出する。
  • admin SDK の秘密鍵(service account の private_key)がソースに混入しクライアントバンドルへ露出するのを検出する。

Non-goals / 扱わないこと

  • Firestore のクエリ効率やインデックス設計。
  • Cloud Functions のロジック妥当性。
  • ルールの粒度(コレクション分割方針)の良し悪し(要件依存のため一律指摘しない)。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。

  • 差分に Security Rules(*.rules / firestore.rules / storage.rules)の追加・変更、または firebase*.{ts,js} の config 変更が含まれている
  • diff コンテキストが利用可能である

ゲート不成立時の出力: NO_REVIEW: firebase-security-rules — Security Rules / config の変更なし

False-positive guards / 抑制条件

  • 公開コレクション(公開ブログ記事等)で allow read の公開が要件上正当であり、その旨のコメントが明記されている場合は read の公開を指摘しない(write の公開は別途指摘する)。
  • Firebase の API key(apiKey)はクライアント公開が公式仕様であり秘密情報ではない。これを「秘密露出」と誤検出しない(admin SDK の private_key とは明確に区別する)。
  • emulator / test 用のルールファイル(*.test.rules 等)は別スコープのため指摘しない。

Rule / ルール

  • allow read, write: if true; のような無条件許可は禁止。所有者・認可条件を必須とする。
  • request.auth != null のみで write を許可しているものは所有者チェック(request.auth.uid == resource.data.ownerId 等)を追加する。
  • allow write に request.auth 条件が無いものは認証チェックを追加する。
  • service account の private_key / admin SDK 初期化用秘密鍵がクライアント側コードに含まれていないか確認する(サーバー専用に隔離する)。

Evidence / 根拠の取り方

  • 指摘は <file>:<line> で差分に紐づけ、公式規約(rules/basics / rules-and-auth)を 1 行で添える。
  • 所有者条件が diff 外の関数定義にある可能性がある場合は断定せず慎重に扱う。

Output / 出力(短文版の推奨)

コメントは日本語で返す。

  • Finding: 過剰許可 / 認可欠如 / 秘密露出のどれか(1文)
  • Impact: 他人のデータ書き換え / 不正アクセス / 鍵漏洩
  • Fix: 所有者条件追加 / request.auth 条件追加 / 秘密鍵のサーバー隔離の最小案

Sources / 出典

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What this skill does>

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

画像・ボタン・フォーム要素に適切なアクセシブルネームがあるか確認する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

Ensure ADRs capture context, decision, alternatives, tradeoffs, and follow-ups in a way that prevents future drift.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

敵対的分析手法を統合したレビューの entry skill。認知バイアス対策の3手法 (Pre-mortem / War Game / Logic Torturing)と、宣言・主張と実態の乖離を突く claim-vs-actual 検出3パターン(Self-Contradiction / Refactor-Claim Audit / Cross-File Leakage)へルーティングし、通常のレビューでは見えない設計の盲点・ 防御の穴・論理の弱点・宣言と実装のズレを可視化する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

Review changes to the Agent Skills import/export bridge for path safety, round-trip fidelity, and validation correctness.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

Checks whether AI-assisted work defines review criteria, accessible context, explicit review loop, human judgment boundary, and feedback capture before delegating to an agent.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

See all skills by s977043

Report a problem with this skill