cloudflare/security-audit-skill:20 个 Markdown 文件怎么成了 Cloudflare 内部漏洞扫描器

Tech-Experiment #安全#AI Agent#Claude Code#Cloudflare#漏洞扫描#开源拆解
🇨🇳 中文

开源仅供学习:本文所涉项目均来自公开仓库,分析仅供技术研究。


项目背景

cloudflare/security-audit-skill(GitHub:github.com/cloudflare/security-audit-skill)——MIT 许可证,22,042 stars,1,276 forks,2026 年 6 月 18 日首次提交。

作者是 Cloudflare 安全工程师 Dan Jones(GitHub:literally-dan),9 of 11 commits 归属此 ID,项目的直接前身是 Cloudflare 内部的 Project Glasswing 漏洞发现 pipeline。README 里写得清楚:「这是催生 Cloudflare 内部漏洞发现 harness 的那个 skill,而那个 harness 已演化为覆盖全体基础设施的多阶段流水线。」


第一个反直觉结论:它不是一个扫描工具

22K star 项目,整个仓库的「核心代码」是:

  • 20 个 Markdown 文件(约 300KB 结构化提示词)
  • 2 个零依赖 Node.js 文件(validate-findings.cjs、validate-coverage-ledger.cjs),纯粹做 JSON schema 校验,不扫描代码

没有扫描引擎,没有 SAST 规则集,没有外部 API 调用,没有 MCP 服务器接入。

这个 skill 的运行方式是:把结构化指令交给编码 agent(Claude Code / Codex / Cursor),agent 自己去阅读代码、生成候选漏洞、互相质疑、最终输出报告。能力上限等于 agent 的代码理解能力。


六阶段流程:发现者不能验证自己的发现

这是架构里最关键的设计决策:

Phase 1 — Reconnaissance 父 agent 扫描整个代码库,绘制信任边界、输入面、架构图,输出 architecture.md + coverage-ledger.json(覆盖清单)。由 RECONNAISSANCE.md 驱动(15,902 字节提示词)。

Phase 2 — Coverage-led hunting waves 父 agent 按覆盖清单把任务分配给隔离的「hunter agent」。每个 hunter 只知道自己的任务单元,写结果到自己的 scratch/ 目录,返回结构化 JSON。由 HUNTING.md 驱动(22,446 字节)。

Phase 3 — Candidate validation(关键) 每一个候选漏洞交给全新的 verifier agent,任务不是确认,而是反驳。找到这个 bug 的 hunter 不参与验证——这是对 confirmation bias 的架构级防御。

Phase 4 — Structured output 父 agent 把通过验证的记录分类写入 findings.json:confirmed(已确认)、needs_validation(需进一步验证)、rejected(已驳回)。

Phase 5 — Independent record verification 再一批新 agent 对最终源码引用做独立核查,防止幻觉写入文件路径或行号。

Phase 6 — Target-neutral reporting 输出 REPORT.md、FINDINGS-DETAIL.md、NEEDS-VALIDATION.md,严禁在报告中放探测真实端点的指令。


漏洞分类:13 个攻击域,含专门的 AI/LLM 安全层

文件覆盖范围
ATTACK-CLASSES.md注入、访问控制、资源/文件处理、密码学与密钥、业务逻辑、功能滥用与数据泄露、链式漏洞
AI-AND-LLM.md代码层提示注入、跨 session 上下文混淆、记忆污染、工具参数注入、过度授权、MCP 身份混淆、action-binding 失效
WEB-PROTOCOL-AND-AUTH.mdHTTP 请求拼装、缓存投毒、JWT/OAuth/OIDC/SAML、CSRF、MFA/passkey、mTLS
CLIENT-SIDE.mdDOM XSS、原型污染、postMessage 信任源、service worker、CORS、WebSocket
SUPPLY-CHAIN-AND-RELEASE.md依赖解析、CI/CD、发布/签名/推广链路、更新机制、插件
CLOUD-AND-DEPLOYMENT.mdIAM、IaC、容器/K8s、serverless/edge、ingress、运行时配置
MEMORY-SAFETY-AND-BINARY.md缓冲区溢出、UAF、整数溢出、ABI、并发、内核模块
……其余 6 个gRPC/GraphQL/Protobuf、资源耗尽/配额绕过、多租户数据隔离、桌面/移动/本地 IPC

AI/LLM 安全层的重要限定:文件明确写道「单纯的提示注入不构成 finding」,必须有代码层的边界失效才能上报。这比大多数 AI 安全讨论更严格。


findings.json 格式:严格结构化,带溯源链路

每个 confirmed 条目必须包含:

  • fingerprint:稳定的源码派生标识符(跨多次运行可追踪)
  • trace:entrypoint → propagation → sink 完整调用链(每步含文件 + 行号)
  • evidence:文件 + 行号
  • execution:沙箱内可复现的执行方式
  • severity:likelihood × impact 双维度,各 5 级(informational/low/medium/high/critical),另有 overall_severity
  • remediation:修复建议

severity 锚定:

  • Critical = 未认证 RCE 或全数据存储接管
  • High = 认证绕过、跨租户读写、存储型 XSS
  • Medium = 有限影响范围
  • Low = 非密钥型信息泄露
  • Informational = 最小影响的观察

needs_validation 条目没有 severity 字段——设计原则是:尚待验证意味着存在未解析的具体边界假设,而不是低置信度的已确认漏洞。


Cloudflare 内部数字(Project Glasswing)

来自 README 链接的官方博客:

指标数值
审计仓库数145 个
原始候选总量20,799 个
验证通过数12,057 个(58% 高置信率)
交付给工程团队的可行 finding7,245 个
典型 30K 行仓库约 80 个 distinct bug,约 14 小时
验证误拒率改善从 40% 降至 11%

单次运行的局限:README 明确说「在测试中,单次运行约发现总 bug 的一半;多次迭代运行才能覆盖完整」。这个 skill 是为迭代设计的,不是一次性扫全。


四个已知限制

  1. 不扫已知 CVE:一个已开放的 issue 明确要求 README 标注「依赖 CVE/advisory 扫描不在范围内」。它不查 NVD/OSV/GitHub Advisory Database,不替代 Snyk 或 Dependabot。

  2. 不测真实端点:所有验证必须在本地沙箱内,不允许探测线上系统。涉及 CDN 规则、代理配置、身份提供商行为的 finding 一律进 needs_validation。

  3. Windows 沙箱兼容问题:多个 issue 报告 validate-findings.cjs 在 Windows 上因缺少 O_NOFOLLOW 无法安全操作文件,修复 PR 尚未合并。

  4. 预算门控:大型仓库运行成本高,skill 有明确的预算检查点——预算不足以支付 recon + hunters + verifiers 时,直接放弃本次审计而不是部分运行。


与传统扫描器的定位差异

这个 skill 明确不与 Snyk / Semgrep / Dependabot 竞争——它的 README 写道:「Severity 需要 impact。是 likelihood × impact,不是偏离检查清单的程度。防御纵深缺失不是漏洞。」

它的差异化在 business logic 类 和 AI/LLM 类:标准 SAST 工具无法理解跨服务业务规则、多租户权限模型的逻辑漏洞,也不理解 MCP 工具链的身份混淆。这两块是 Cloudflare 这个 skill 真正的护城河。


安装与调用

# 通过 Skills CLI 安装
npx skills add https://github.com/cloudflare/security-audit-skill --skill security-audit

# 在 Claude Code / Codex 里调用
security audit this codebase
find security vulnerabilities in ./src
do a security review, output to ~/audits/my-project

两种模式:

  • Guidance mode(默认):回答安全问题、做专项代码评审,不启动完整六阶段流程
  • Full audit mode:需要显式说「audit」「pen-test」「comprehensive review」或要求产出报告文件才触发

综合判断

cloudflare/security-audit-skill 的核心价值不在于技术新颖性,而在于把 Cloudflare 生产级漏洞发现 pipeline 的流程设计开源出来:对抗验证、finder 不做 validator、结构化 findings 溯源链路、迭代覆盖——这些工程决策都是可以直接借用的。

如果你的项目只需要扫 known CVE,用 Dependabot 就够。如果你需要挖 business logic、AI/LLM 边界、多租户隔离这些「没有规则可以写的漏洞」,这个 skill 值得认真看。


开源仅供学习,商业使用请仔细核查许可证条款。


🇬🇧 English

cloudflare/security-audit-skill: How 20 Markdown Files Became Cloudflare’s Internal Vulnerability Scanner

Open source for learning only: Analysis is for technical research purposes only.


Project Background

cloudflare/security-audit-skill (github.com/cloudflare/security-audit-skill) — MIT license, 22,042 stars, 1,276 forks, first commit June 18, 2026.

Author: Cloudflare security engineer Dan Jones (literally-dan), who authored 9 of 11 commits. The direct predecessor is Cloudflare’s internal Project Glasswing vulnerability discovery pipeline. The README states explicitly: “This is the skill that seeded Cloudflare’s vulnerability discovery harness, which has since evolved into a fleet-wide multi-stage pipeline.”


First Counterintuitive Finding: It’s Not a Scanning Tool

22K star project. The entire “core code” is:

  • 20 Markdown files (~300KB of structured instructions)
  • 2 zero-dependency Node.js files (validate-findings.cjs, validate-coverage-ledger.cjs) — pure JSON schema validators, not scanners

No scanning engine. No SAST ruleset. No external API calls. No MCP server integration.

This skill works by handing structured instructions to a coding agent (Claude Code / Codex / Cursor), which reads your code, generates vulnerability candidates, has other agents challenge those candidates, and finally outputs a report. The capability ceiling equals the agent’s code comprehension ability.


The Six-Phase Workflow: The Finder Never Validates Its Own Findings

The most critical design decision in the architecture:

Phase 1 — Reconnaissance: Parent agent maps trust boundaries, input surfaces, architecture. Outputs architecture.md + coverage-ledger.json.

Phase 2 — Coverage-led hunting waves: Parent agent assigns isolated “hunter agents” from the coverage ledger. Each hunter only knows its own unit, writes to scratch/, returns structured JSON.

Phase 3 — Candidate validation (critical): Every candidate vulnerability goes to a fresh verifier agent whose job is to disprove it. The hunter that found it doesn’t participate — this is an architectural defense against confirmation bias.

Phase 4 — Structured output: Parent writes verified records to findings.json: confirmed, needs_validation, rejected.

Phase 5 — Independent record verification: Another batch of fresh agents independently verifies source code citations to prevent hallucinated file paths or line numbers.

Phase 6 — Target-neutral reporting: Outputs REPORT.md, FINDINGS-DETAIL.md, NEEDS-VALIDATION.md. No live endpoint probing instructions permitted in reports.


13 Attack Domains, Including a Dedicated AI/LLM Security Layer

Notable: the AI-AND-LLM.md domain covers prompt injection (code-level boundary failures only), cross-session context bleed, memory poisoning, tool-argument injection, excessive agency, MCP server identity confusion, and action-binding failures.

The file explicitly states: “prompt injection alone is not a finding” — a code-level boundary failure must be present. This is a stricter bar than most AI security discussions apply.


Cloudflare Internal Numbers (Project Glasswing)

MetricValue
Repos audited145
Raw candidates generated20,799
Survived validation12,057 (58% high-integrity rate)
Actionable findings delivered7,245
Typical 30K-line repo~80 distinct bugs, ~14 hours
Validation rejection rateImproved from 40% to 11%

Single-run coverage caveat: README explicitly states a single run finds roughly half the vulnerabilities that repeated runs find in total. This skill is designed for iterative use.


Four Key Limitations

  1. No CVE scanning: Doesn’t query NVD/OSV/GitHub Advisory Database. Doesn’t replace Snyk or Dependabot for known vulnerability lookup.
  2. No live endpoint testing: All validation must be local, sandboxed. Cloud config behavior (CDN rules, proxy settings) becomes needs_validation.
  3. Windows sandbox compatibility issues: Multiple open issues report validate-findings.cjs can’t safely open files on Windows; fix PR unmerged.
  4. Budget gating: If the budget can’t fund recon + hunters + verifiers, the skill abandons the audit pass entirely rather than running partially.

Positioning vs. Traditional Scanners

This skill doesn’t compete with Snyk/Semgrep/Dependabot. Its differentiation is in business logic and AI/LLM attack classes — areas where pattern-matching SAST tools have no rules to write: cross-service business logic flaws, multi-tenant permission model violations, MCP tool chain identity confusion.


Open source for learning only. Check license terms carefully before commercial use.

💬 评论与讨论

使用 GitHub 账号登录后发表评论

关于本站 · 免责声明

🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。

⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.

  1. 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
  2. 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
  3. 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
  4. 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。

📮 侵权 / 勘误 / 合作咨询:[email protected]