ablevarghese/ios-claude-toolkit/trailofbits-differential-review

Claude Code and agent skill by ablevarghese/ios-claude-toolkit

Trust tier 2
  • community
LLM review pending
Source check pending

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-review

SKILL.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

  1. Risk-First: Focus on auth, crypto, value transfer, external calls
  2. Evidence-Based: Every finding backed by git history, line numbers, attack scenarios
  3. Adaptive: Scale to codebase size (SMALL/MEDIUM/LARGE)
  4. Honest: Explicitly state coverage limits and confidence level
  5. Output-Driven: Always generate comprehensive markdown report file

Rationalizations (Do Not Skip)

RationalizationWhy It's WrongRequired 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 kSecAttrAccessibleWhenUnlockedThisDeviceOnly to a less restrictive level exposes data. STOP. Requires security justification.
  • BLOCKED: Biometric authentication policy changed -- switching from .deviceOwnerAuthenticationWithBiometrics to .deviceOwnerAuthentication adds 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-security for 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-bugs for 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 SizeStrategyApproach
SMALL (<20 files)DEEPRead all deps, full git blame
MEDIUM (20-200)FOCUSED1-hop deps, priority files
LARGE (200+)SURGICALCritical paths only
Risk Level Triggers
Risk LevelTriggers
HIGHAuth, crypto, external calls, value transfer, validation removal, Keychain, biometric, certificate pinning
MEDIUMBusiness logic, state changes, new public APIs, deep link handling, data model changes
LOWComments, tests, UI styling, logging, localization

Decision Framework

PR/diff received for security review
|
+-- Phase 0: Triage
| +-- List all changed files
| +-- Classify each by risk level (HIGH/MEDIUM/LOW)
| +-- Any HIGH risk files?
| +-- YES --> Full review (all phases)
| +-- NO, but MEDIUM --> Focused review (Phases 0-3, skip Phase 4-5 unless concerns found)
| +-- ALL LOW --> Quick review + document coverage limits
|
+-- Phase 1: Code Analysis
| +-- Read diffs line by line for HIGH/MEDIUM files
| +-- Check git blame on security-relevant removed code
| +-- Trace data flow across trust boundaries
| |
| +-- iOS-specific checks:
| +-- URL scheme / deep link handlers changed? --> Check for injection
| +-- Keychain operations changed? --> Check accessibility levels
| +-- Biometric auth changed? --> Check policy and fallback
| +-- Pasteboard operations? --> Check for sensitive data exposure
| +-- WebView configuration? --> Check for JavaScript injection
|
+-- Phase 2: Test Coverage
| +-- Find tests for each changed file
| +-- Are new code paths tested?
| +-- Are security-specific scenarios tested?
| +-- Missing tests? --> Elevate risk rating
|
+-- Phase 3: Blast Radius
| +-- Count callers of changed functions
| +-- Identify transitive dependencies
| +-- HIGH blast radius? --> Phase 4 required
|
+-- Phase 4: Deep Context (HIGH risk only)
| +-- Check git history for security-related commits
| +-- Review architecture docs for security constraints
| +-- Check dependencies for known vulnerabilities
|
+-- Phase 5: Adversarial Analysis (HIGH risk findings)
| +-- Model attacker perspective
| +-- Build concrete exploit scenarios
| +-- See references/attack-scenarios.md for iOS-specific scenarios
|
+-- Phase 6: Report
+-- Generate report using references/report-template.md
+-- Summarize for user

Workflow

Pre-Analysis -> Phase 0: Triage -> Phase 1: Code Analysis -> Phase 2: Test Coverage
| | | |
Phase 3: Blast Radius -> Phase 4: Deep Context -> Phase 5: Adversarial -> Report

Phase 0: Triage

Phase Gate: FILE-LEVEL TRIAGE ✓

Cannot proceed to Phase 1 until EVERY changed file is individually classified.

bash
# Get changed files
git diff --name-only HEAD~1..HEAD
# Or for a PR
git diff --name-only main..HEAD

Classify EACH file individually — not by category, not by change type. Every. Single. File.

Output format (mandatory):

| # | File | Risk | Reason |
|---|------|------|--------|
| 1 | AuthService.swift | HIGH | Touches authentication flow |
| 2 | TokenStorage.swift | HIGH | Handles credential storage |
| 3 | README.md | LOW | Documentation only |

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:

  1. Read the diff carefully, line by line
  2. Check git blame on removed security-relevant code:

``bash git log --oneline -10 -- path/to/file.swift git blame path/to/file.swift ``

  1. Trace data flow from inputs to outputs
  2. 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
swift
// RED FLAG: URL scheme handler without input validation
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
let action = url.host // UNVALIDATED -- attacker controls this value
performAction(action!) // Force unwrap + unvalidated input = crash + injection
return true
}

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ablevarghese/ios-claude-toolkit/trailofbits-differential-review/badge)](https://verified-skill.com/skills/ablevarghese/ios-claude-toolkit/trailofbits-differential-review)

Something wrong with this skill or its page? Tell us.