ablevarghese/ios-claude-toolkit/trailofbits-differential-review
Claude Code and agent skill by ablevarghese/ios-claude-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Is this change safe, security implications of this PR, did we break any security. Security-focused differential code review for PRs, commits, and diffs — blast radius calculation, adversarial analysis, test coverage verification, vulnerability pattern detection. Trigger on: 'review this PR for security', 'could this introduce a vulnerability', 'check if the refactor broke security', 'what's the risk of merging this', or any security-focused review of specific changes. For broad security audits not tied to a diff, use cipher-security instead.
Install
npx vskill@latest install ablevarghese/ios-claude-toolkit/trailofbits-differential-reviewSKILL.md
The same SKILL.md was published earlier as ablevarghese/ios-claude-toolkit/trailofbits-differential-review.
Differential Security Review
Iron Law: "Security review is not optional for changes touching auth, crypto, payments, or external calls. Size of the diff is irrelevant -- Heartbleed was 2 lines."
Security-focused code review for PRs, commits, and diffs.
Source: github.com/trailofbits/skills
Core Principles
- Risk-First: Focus on auth, crypto, value transfer, external calls
- Evidence-Based: Every finding backed by git history, line numbers, attack scenarios
- Adaptive: Scale to codebase size (SMALL/MEDIUM/LARGE)
- Honest: Explicitly state coverage limits and confidence level
- Output-Driven: Always generate comprehensive markdown report file
Rationalizations (Do Not Skip)
| Rationalization | Why It's Wrong | Required Action | |
|---|---|---|---|
| "Small PR, quick review" | Heartbleed was 2 lines. The goto fail bug was one duplicated line. | Classify by RISK, not size | |
| "I know this codebase" | Familiarity breeds blind spots. You stop seeing what you expect to be there. | Build explicit baseline context | |
| "Git history takes too long" | History reveals regressions, reverted security fixes, and patterns of past vulnerabilities. | Never skip Phase 1 | |
| "Blast radius is obvious" | Transitive callers get missed. A change to a utility function can affect 200+ call sites. | Calculate quantitatively | |
| "No tests = not my problem" | Missing tests = elevated risk rating. You can't verify the change is safe without tests. | Flag in report, elevate severity | |
| "Just a refactor, no security impact" | Refactors break invariants. Moving code between modules can cross trust boundaries. Access control changes hide in refactors. | Analyze as HIGH until proven LOW | |
| "I'll explain verbally" | No artifact = findings lost. The next reviewer won't know what you checked. | Always write report | |
| "It's internal code, not user-facing" | Internal code handles user data. Injection, access control, and data leaks happen in internal code. | Apply the same rigor to all code that touches sensitive data | |
| "The tests pass, so it's safe" | Tests verify intended behavior. Security bugs are about unintended behavior. Tests don't test for attacks. | Test coverage is necessary but not sufficient. Adversarial analysis is separate. |
Red Flags -- HARD STOP
These are not warnings. Each is a BLOCKING condition. If encountered, STOP all other work until the condition is resolved or explicitly accepted by the owner.
- BLOCKED: Removed code from commits with "security", "CVE", or "fix vulnerability" in the message -- this is a potential security regression. STOP. Investigate why the fix was removed. Cannot proceed without understanding and documenting the justification.
- BLOCKED: Access control modifiers weakened (e.g.,
private->public,internal->open) -- especially on methods that handle auth, crypto, or data access. STOP. Document why the change is necessary and what exposure it creates. - BLOCKED: Validation removed without replacement -- if input validation, bounds checking, or sanitization was removed, STOP. The change is HIGH risk until proven otherwise. Require explicit justification.
- BLOCKED: External calls added without error handling or input validation -- new network requests, IPC calls, or URL scheme handlers without proper validation are injection vectors. STOP. Add validation before proceeding.
- BLOCKED: High blast radius (50+ callers) combined with HIGH risk change -- requires full impact analysis. STOP. A bug here affects the entire app. Cannot proceed without sampling callers.
- BLOCKED: Certificate pinning disabled or weakened -- any change to pinning configuration, SSL trust evaluation, or ATS exceptions. STOP. Requires immediate investigation and owner approval.
- BLOCKED: Keychain accessibility level changed -- changing from
kSecAttrAccessibleWhenUnlockedThisDeviceOnlyto a less restrictive level exposes data. STOP. Requires security justification. - BLOCKED: Biometric authentication policy changed -- switching from
.deviceOwnerAuthenticationWithBiometricsto.deviceOwnerAuthenticationadds passcode fallback. STOP. May not meet security requirements. Requires owner approval.
When NOT to Use This Skill
- Greenfield code (no baseline to compare) -- use
cipher-securityfor initial security review of new code - Documentation-only changes (no security impact) -- standard review is sufficient
- Formatting/linting (cosmetic changes) -- unless the formatter moved code across trust boundaries
- User explicitly requests quick summary only (they accept risk) -- document that the user accepted reduced review
- Investigating a production crash -- use
sentry-find-bugsfor crash investigation, then return here if the fix needs security review
Behavioral Enforcement
Phase Gate: BLAST RADIUS (For Every HIGH-Risk Change)
Cannot proceed to deep analysis until:
- [ ] Blast radius calculated:
grep -rl "functionName" --include="*.swift" . | wc -l - [ ] All direct callers identified
- [ ] Transitive impact assessed (callers of callers for HIGH blast radius)
Cannot skip for "simple" changes: Heartbleed was 2 lines. Blast radius is calculated by IMPACT, not by diff size.
Phase Gate: GIT HISTORY (For Removed/Changed Security Code)
If code was removed or significantly changed, MUST check:
- [ ]
git log --oneline -10 -- <file>-- why was this code added? - [ ]
git blame <file>-- who added it and when? - [ ] Was it from a commit mentioning "fix", "security", "CVE", or "vulnerability"?
If yes -- CRITICAL ESCALATION: Code that was added to fix a security issue is being removed. This MUST be justified. Cannot proceed without understanding why the original fix was needed and confirming the removal doesn't reintroduce the vulnerability.
Counter-Based Escalation
- Finding #1: Normal. Document with evidence.
- Finding #2: Check for pattern. Are both findings related to the same root cause?
- Finding #3: STOP. Three security findings in one PR is a signal. Consider whether the PR should be restructured, whether the author needs security guidance, or whether a broader security review is needed.
- Still finding issues: ESCALATE to human partner with: all findings documented, pattern analysis, recommendation on whether to proceed or request rework.
Quick Reference
Codebase Size Strategy
| 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
| Risk Level | Triggers | |
|---|---|---|
| HIGH | Auth, crypto, external calls, value transfer, validation removal, Keychain, biometric, certificate pinning | |
| MEDIUM | Business logic, state changes, new public APIs, deep link handling, data model changes | |
| LOW | Comments, tests, UI styling, logging, localization |
Decision Framework
Workflow
Phase 0: Triage
Phase Gate: FILE-LEVEL TRIAGE ✓
Cannot proceed to Phase 1 until EVERY changed file is individually classified.
Classify EACH file individually — not by category, not by change type. Every. Single. File.
Output format (mandatory):
If the PR says "12 files changed", your triage table must have 12 rows. If you classify by category instead of by file, the triage is INCOMPLETE — go back and list each file individually. Category-level triage misses the file that doesn't fit neatly into a category but still has security implications.
Risk classification per file:
- HIGH: Files touching auth, crypto, payments, validation, access control, external calls, Keychain, biometric, certificate pinning, URL scheme handling, entitlements
- MEDIUM: Business logic, state management, API endpoints, data models, navigation, deep links
- LOW: Comments, documentation, UI styling, test files, logging, localization
Phase 1: Code Analysis
For each HIGH and MEDIUM risk file:
- Read the diff carefully, line by line
- Check git blame on removed security-relevant code:
``bash git log --oneline -10 -- path/to/file.swift git blame path/to/file.swift ``
- Trace data flow from inputs to outputs
- Identify trust boundaries crossed by the change
iOS-Specific Analysis Points
For each changed file, check for these iOS-specific vulnerability patterns. See references/vulnerability-patterns.md for the full catalog.
URL Scheme / Universal Link Changes
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/trailofbits-differential-review/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ablevarghese/ios-claude-toolkit/trailofbits-differential-review)