firebase/agent-skills

firebase-security-rules-auditor

从可绕过的操作序列检查数据访问规则

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

firebase-security-rules-auditor 是什么?

firebase-security-rules-auditor 审查Firestore及Cloud Storage规则中的越权与校验漏洞,重点比较创建与更新、权限来源、字段限制和所有权。它按指定JSON结构列出评分、问题及修复建议,属于规则审查流程。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 已有规则需要审查,特别是角色提升、跨用户修改、create/update不一致等问题。

这些情况不适合

  • 用规则评分代替整个应用安全结论,或把审查当成已部署修复。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 firebase-security-rules-auditor,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 firebase-security-rules-auditor

请在 Codex 的当前工作环境中安装并检查 firebase-security-rules-auditor 这个 Skill。

项目身份:firebase/agent-skills / firebase-security-rules-auditor
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-security-rules-auditor/SKILL.md
已定位的源文件:skills/firebase-security-rules-auditor/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 提供完整规则与对应业务角色、数据模型、合法协作需求;要实测绕过还需可控模拟环境和代表性用户身份。

会得到什么

  • 按源文1至5评分的规则审查JSON,以及具体可解释的漏洞或缺失条件。

实际使用顺序

  1. 比较create与update,看用户是否能先创建合法记录,再更新成越权角色、错误类型或超大内容。
  2. 追查role、isAdmin和ownerId的可信来源;hasOnly/diff只限制字段集合,还须检查谁能修改。
  3. 对照合法协作业务,检查读写是否过严而迫使应用绕开规则,并核对字符串、数组、类型和所有权限制。
  4. 返回score、summary和findings JSON,每条写check、severity、issue与recommendation;如未运行模拟器,明确只是静态分析。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

用 firebase-security-rules-auditor 静态审查我提供的firestore.rules。重点测试思路:普通用户能否更新别人的displayName,能否在创建后把自己的role变为admin。按来源JSON返回问题和建议,区分可由规则直接推出的结论与仍需模拟验证的假设。不要部署或更改规则。
预期结果

预期每项发现都有具体条件与修复建议;本站未执行规则攻击或运行测试。

使用前先看这些限制

使用条件与边界

  • 分数是这份Skill的审查尺度,不是第三方认证,也不证明业务整体没有漏洞。
  • 该版本对验证过邮箱的单一硬编码管理员有特定评分条件,不能外推为所有硬编码权限设计都安全。
针对这个 Skill 的疑问

常见问题

hasOnly限制了可改字段,就安全了吗?

不一定。它不自动检查修改者是谁,仍需所有权或可信角色条件,否则登录用户可能修改别人的允许字段。

create规则严格,update可以宽松吗?

应比较二者。来源专门检查先合法创建再非法更新的绕过链,不能只审核创建。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-19T19:32:10.677Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/firebase-security-rules-auditor/SKILL.md · 抓取时间 2026-11-19T19:32:10.677Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.

查看源文件章节 / Source sections
  • 原文:Overview
  • 原文:Scoring Criteria
  • 原文:Assessment: Security Validator (Red Team Edition)
  • 原文:Mandatory Audit Checklist:
  • 原文:Admin Bootstrapping & Privileges:
  • 原文:Scoring Criteria (1-5):
原文:Overview

This skill acts as an auditor for Firebase Security Rules, evaluating them against a rigorous set of criteria to ensure they are secure, robust, and correctly implemented.

原文:Assessment: Security Validator (Red Team Edition)

You are a Senior Security Auditor and Penetration Tester specializing in Firestore. Your goal is to find "the hole in the wall." Do not assume a rule is secure because it looks complex; instead, actively try to find a sequence of operations to bypass it.

原文:Mandatory Audit Checklist:

1. **The Update Bypass:** Compare 'create' and 'update' rules. Can a user create a valid document and then 'update' it into an invalid or malicious state (e.g., changing their role, bypassing size limits, or corrupting data types)? 1. **Authority Source:** Does the security rely on user-provided data (request.resource.data) for sensitive fields like 'role', 'isAdmin', or 'ownerId'? Carefully consider the source for that authority. 1. **Business Logic vs. Rules:** Does the rule set actually support the app's purpose? (e.g., In a collaboration app, can collaborators actually read the data? If not, the rules are "broken" or will force insecure workarounds). 1. **Storage Abuse:** Are there string length or array size limits? If not, label it as a "Resource Exhaustion/DoS" risk. 1. **Type Safety:** Are fields checked with 'is string', 'is int', or 'is timestamp'? 1. **Field-Level vs. Identity-Level Security:** Be careful with rules that use `hasOnly()` or `diff()`. While these restrict *which* fields can be updated, they do NOT restrict *who* can update them unless an ownership check (e.g., `resource.data.uid == request.auth.uid`) is also present. If a rule allows any authenticated user to update fields on another user's document without a corresponding ownership check, it is a data integrity vulnerability.

原文:Admin Bootstrapping & Privileges:

The admin bootstrapping process is limited in this app. If the rules use a single hardcoded admin email (e.g., checking request.auth.token.email == 'admin@example.com'), this should NOT count against the score as long as: - email_verified is also checked (request.auth.token.email_verified == true). - It is implemented in a way that does not allow additional admins to add themselves or leave an escalation risk open.

原文:Scoring Criteria (1-5):

- **1 (Critical):** Unauthorized data access (leaks), privilege escalation, or total validation bypass. - **2 (Major):** Broken business logic, self-assigned roles, bypass of controls. - **3 (Moderate):** PII exposure (e.g., public emails), Inconsistent validation (create vs update) on critical fields - **4 (Minor):** Problems that result in self-data corruption like update bypasses that only impact the user's own data, lack of size limits, missing minor type checks or over-permissive read access on non-sensitive fields. - **5 (Secure):** Comprehensive validation, strict ownership, and role-based access via secure ACLs. Return your assessment in JSON format using the following structure: ```json { "score": 1, "summary": "overall assessment", "findings": [ { "check": "checklist item", "severity": "critical|major|moderate|minor", "issue": "description", "recommendation": "fix" } ] } ```

文件 SHA256:6522cd9e61ca577e80326b7204b69883822e1bdf1846b0c829c43993fdeb3b4a

仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。

Skills.sh收录简介 · 2026-07-28

Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识firebase-security-rules-auditor
来源仓库firebase/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次266
快照累计安装量79898

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源