differential-review by trailofbits/skills
npx skills add https://github.com/trailofbits/skills --skill differential-review针对 PR、提交和差异的安全导向代码审查。
| 错误理由 | 为何错误 | 必需行动 |
|---|---|---|
| "PR 很小,快速审查即可" | Heartbleed 漏洞仅由 2 行代码引起 | 按风险分类,而非大小 |
| "我了解这个代码库" | 熟悉度会导致盲点 | 建立明确的基线上下文 |
| "查看 Git 历史太耗时" | 历史记录能揭示回归问题 | 切勿跳过阶段 1 |
| "影响范围显而易见" | 你会遗漏间接调用者 | 进行定量计算 |
| "没有测试 = 不是我的问题" | 缺少测试 = 风险等级提升 | 在报告中标记,提高严重性 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| "只是重构,没有安全影响" | 重构可能破坏不变量 | 先按高风险分析,直到证明为低风险 |
| "我会口头解释" | 没有记录 = 发现会丢失 | 始终撰写报告 |
| 代码库规模 | 策略 | 方法 |
|---|---|---|
| 小型 (<20 个文件) | 深度 | 阅读所有依赖项,完整的 git blame |
| 中型 (20-200) | 聚焦 | 1 跳依赖项,优先文件 |
| 大型 (200+) | 精准 | 仅关键路径 |
| 风险等级 | 触发条件 |
|---|---|
| 高 | 身份验证、加密、外部调用、价值转移、验证移除 |
| 中 | 业务逻辑、状态变更、新的公共 API |
| 低 | 注释、测试、UI、日志记录 |
Pre-Analysis → Phase 0: Triage → Phase 1: Code Analysis → Phase 2: Test Coverage
↓ ↓ ↓ ↓
Phase 3: Blast Radius → Phase 4: Deep Context → Phase 5: Adversarial → Phase 6: Report
开始审查?
├─ 需要详细的阶段方法论?
│ └─ 阅读:methodology.md
│ (Pre-Analysis + Phases 0-4: triage, code analysis, test coverage, blast radius)
│
├─ 分析高风险变更?
│ └─ 阅读:adversarial.md
│ (Phase 5: Attacker modeling, exploit scenarios, exploitability rating)
│
├─ 撰写最终报告?
│ └─ 阅读:reporting.md
│ (Phase 6: Report structure, templates, formatting guidelines)
│
├─ 查找特定漏洞模式?
│ └─ 阅读:patterns.md
│ (Regressions, reentrancy, access control, overflow, etc.)
│
└─ 仅需快速分类?
└─ 使用上方的快速参考,跳过详细文档
交付前检查:
audit-context-building 技能:
issue-writer 技能:
issue-writer --input DIFFERENTIAL_REVIEW_REPORT.md --format audit-reportInput: 5 file PR, 2 HIGH RISK files
Strategy: Use Quick Reference
1. Classify risk level per file (2 HIGH, 3 LOW)
2. Focus on 2 HIGH files only
3. Git blame removed code
4. Generate minimal report
Time: ~30 minutes
Input: 80 files, 12 HIGH RISK changes
Strategy: FOCUSED (see methodology.md)
1. Full workflow on HIGH RISK files
2. Surface scan on MEDIUM
3. Skip LOW risk files
4. Complete report with all sections
Time: ~3-4 hours
Input: 450 files, auth system rewrite
Strategy: SURGICAL + audit-context-building
1. Baseline context with audit-context-building
2. Deep analysis on auth changes only
3. Blast radius analysis
4. Adversarial modeling
5. Comprehensive report
Time: ~6-8 hours
对于这些情况,请使用标准代码审查。
立即升级触发条件:
这些模式即使在快速分类中也需要进行对抗性分析。
应做:
不应做:
首次使用者: 从 methodology.md 开始,了解完整的工作流程。
有经验的使用者: 使用本页的快速参考和决策树直接导航到所需内容。
每周安装量
1.4K
代码仓库
GitHub 星标数
3.9K
首次出现
Jan 19, 2026
安全审计
安装于
claude-code1.3K
codex1.2K
opencode1.1K
cursor1.1K
gemini-cli1.0K
github-copilot980
Security-focused code review for PRs, commits, and diffs.
| Rationalization | Why It's Wrong | Required Action |
|---|---|---|
| "Small PR, quick review" | Heartbleed was 2 lines | Classify by RISK, not size |
| "I know this codebase" | Familiarity breeds blind spots | Build explicit baseline context |
| "Git history takes too long" | History reveals regressions | Never skip Phase 1 |
| "Blast radius is obvious" | You'll miss transitive callers | Calculate quantitatively |
| "No tests = not my problem" | Missing tests = elevated risk rating | Flag in report, elevate severity |
| "Just a refactor, no security impact" | Refactors break invariants | Analyze as HIGH until proven LOW |
| "I'll explain verbally" | No artifact = findings lost | Always write report |
| Codebase Size | Strategy | Approach |
|---|---|---|
| SMALL (<20 files) | DEEP | Read all deps, full git blame |
| MEDIUM (20-200) | FOCUSED | 1-hop deps, priority files |
| LARGE (200+) | SURGICAL | Critical paths only |
| Risk Level | Triggers |
|---|---|
| HIGH | Auth, crypto, external calls, value transfer, validation removal |
| MEDIUM | Business logic, state changes, new public APIs |
| LOW | Comments, tests, UI, logging |
Pre-Analysis → Phase 0: Triage → Phase 1: Code Analysis → Phase 2: Test Coverage
↓ ↓ ↓ ↓
Phase 3: Blast Radius → Phase 4: Deep Context → Phase 5: Adversarial → Phase 6: Report
Starting a review?
├─ Need detailed phase-by-phase methodology?
│ └─ Read: methodology.md
│ (Pre-Analysis + Phases 0-4: triage, code analysis, test coverage, blast radius)
│
├─ Analyzing HIGH RISK change?
│ └─ Read: adversarial.md
│ (Phase 5: Attacker modeling, exploit scenarios, exploitability rating)
│
├─ Writing the final report?
│ └─ Read: reporting.md
│ (Phase 6: Report structure, templates, formatting guidelines)
│
├─ Looking for specific vulnerability patterns?
│ └─ Read: patterns.md
│ (Regressions, reentrancy, access control, overflow, etc.)
│
└─ Quick triage only?
└─ Use Quick Reference above, skip detailed docs
Before delivering:
audit-context-building skill:
issue-writer skill:
issue-writer --input DIFFERENTIAL_REVIEW_REPORT.md --format audit-reportInput: 5 file PR, 2 HIGH RISK files
Strategy: Use Quick Reference
1. Classify risk level per file (2 HIGH, 3 LOW)
2. Focus on 2 HIGH files only
3. Git blame removed code
4. Generate minimal report
Time: ~30 minutes
Input: 80 files, 12 HIGH RISK changes
Strategy: FOCUSED (see methodology.md)
1. Full workflow on HIGH RISK files
2. Surface scan on MEDIUM
3. Skip LOW risk files
4. Complete report with all sections
Time: ~3-4 hours
Input: 450 files, auth system rewrite
Strategy: SURGICAL + audit-context-building
1. Baseline context with audit-context-building
2. Deep analysis on auth changes only
3. Blast radius analysis
4. Adversarial modeling
5. Comprehensive report
Time: ~6-8 hours
For these cases, use standard code review instead.
Immediate escalation triggers:
These patterns require adversarial analysis even in quick triage.
Do:
Don't:
For first-time users: Start with methodology.md to understand the complete workflow.
For experienced users: Use this page's Quick Reference and Decision Tree to navigate directly to needed content.
Weekly Installs
1.4K
Repository
GitHub Stars
3.9K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
claude-code1.3K
codex1.2K
opencode1.1K
cursor1.1K
gemini-cli1.0K
github-copilot980
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装