@elizaos/skills 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -0
- package/dist/formatter.d.ts +44 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +182 -0
- package/dist/frontmatter.d.ts +39 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +105 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/loader.d.ts +33 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +362 -0
- package/dist/resolver.d.ts +18 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +90 -0
- package/dist/types.d.ts +201 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +57 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +96 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/bird/SKILL.md +224 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +203 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +284 -0
- package/skills/discord/SKILL.md +578 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/food-order/SKILL.md +48 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +77 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +74 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +102 -0
- package/skills/local-places/pyproject.toml +21 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/nano-banana-pro/SKILL.md +58 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/notion/SKILL.md +172 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +89 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +51 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/security-ask-questions-if-underspecified/.claude-plugin/plugin.json +10 -0
- package/skills/security-ask-questions-if-underspecified/README.md +24 -0
- package/skills/security-ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-ask-questions-if-underspecified/skills/ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-audit-context-building/.claude-plugin/plugin.json +10 -0
- package/skills/security-audit-context-building/README.md +58 -0
- package/skills/security-audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/commands/audit-context.md +21 -0
- package/skills/security-audit-context-building/skills/audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/COMPLETENESS_CHECKLIST.md +47 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md +355 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/OUTPUT_REQUIREMENTS.md +71 -0
- package/skills/security-building-secure-contracts/.claude-plugin/plugin.json +10 -0
- package/skills/security-building-secure-contracts/README.md +241 -0
- package/skills/security-building-secure-contracts/SKILL.md +67 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md +284 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +405 -0
- package/skills/security-building-secure-contracts/skills/audit-prep-assistant/SKILL.md +409 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md +329 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +722 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/SKILL.md +218 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/ASSESSMENT_CRITERIA.md +355 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/EXAMPLE_REPORT.md +248 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/REPORT_FORMAT.md +33 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md +334 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +740 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/SKILL.md +252 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/ASSESSMENT_AREAS.md +329 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/DELIVERABLES.md +118 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/EXAMPLE_REPORT.md +298 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/SKILL.md +161 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/EXAMPLE_REPORT.md +279 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/WORKFLOW_STEPS.md +132 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md +389 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +669 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md +298 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +791 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/SKILL.md +362 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/ASSESSMENT_CATEGORIES.md +571 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/REPORT_TEMPLATES.md +141 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md +388 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +595 -0
- package/skills/security-differential-review/.claude-plugin/plugin.json +10 -0
- package/skills/security-differential-review/README.md +109 -0
- package/skills/security-differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/commands/diff-review.md +21 -0
- package/skills/security-differential-review/skills/differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/skills/differential-review/adversarial.md +203 -0
- package/skills/security-differential-review/skills/differential-review/methodology.md +234 -0
- package/skills/security-differential-review/skills/differential-review/patterns.md +300 -0
- package/skills/security-differential-review/skills/differential-review/reporting.md +369 -0
- package/skills/security-entry-point-analyzer/.claude-plugin/plugin.json +10 -0
- package/skills/security-entry-point-analyzer/README.md +74 -0
- package/skills/security-entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/commands/entry-points.md +18 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md +182 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md +107 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md +87 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solana.md +155 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solidity.md +135 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/ton.md +185 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/vyper.md +141 -0
- package/skills/security-fix-review/.claude-plugin/plugin.json +13 -0
- package/skills/security-fix-review/README.md +118 -0
- package/skills/security-fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/commands/fix-review.md +24 -0
- package/skills/security-fix-review/skills/fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/skills/fix-review/references/bug-detection.md +408 -0
- package/skills/security-fix-review/skills/fix-review/references/finding-matching.md +298 -0
- package/skills/security-fix-review/skills/fix-review/references/report-parsing.md +398 -0
- package/skills/security-insecure-defaults/.claude-plugin/plugin.json +10 -0
- package/skills/security-insecure-defaults/README.md +45 -0
- package/skills/security-insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/security-modern-python/.claude-plugin/plugin.json +10 -0
- package/skills/security-modern-python/README.md +58 -0
- package/skills/security-modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/hooks/hooks.json +16 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.bats +388 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.sh +109 -0
- package/skills/security-modern-python/hooks/test_helper.bash +75 -0
- package/skills/security-modern-python/skills/modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/skills/modern-python/references/dependabot.md +43 -0
- package/skills/security-modern-python/skills/modern-python/references/migration-checklist.md +141 -0
- package/skills/security-modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
- package/skills/security-modern-python/skills/modern-python/references/prek.md +211 -0
- package/skills/security-modern-python/skills/modern-python/references/pyproject.md +254 -0
- package/skills/security-modern-python/skills/modern-python/references/ruff-config.md +240 -0
- package/skills/security-modern-python/skills/modern-python/references/security-setup.md +255 -0
- package/skills/security-modern-python/skills/modern-python/references/testing.md +284 -0
- package/skills/security-modern-python/skills/modern-python/references/uv-commands.md +200 -0
- package/skills/security-modern-python/skills/modern-python/templates/dependabot.yml +36 -0
- package/skills/security-modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
- package/skills/security-property-based-testing/.claude-plugin/plugin.json +9 -0
- package/skills/security-property-based-testing/README.md +47 -0
- package/skills/security-property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/README.md +88 -0
- package/skills/security-property-based-testing/skills/property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/design.md +191 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/generating.md +200 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
- package/skills/semgrep-rule-creator/.claude-plugin/plugin.json +8 -0
- package/skills/semgrep-rule-creator/README.md +43 -0
- package/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/commands/semgrep-rule.md +26 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/quick-reference.md +203 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sharp-edges/.claude-plugin/plugin.json +10 -0
- package/skills/sharp-edges/README.md +48 -0
- package/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +370 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +46 -0
- package/skills/spec-to-code-compliance/.claude-plugin/plugin.json +10 -0
- package/skills/spec-to-code-compliance/README.md +67 -0
- package/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/commands/spec-compliance.md +22 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/static-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/static-analysis/README.md +59 -0
- package/skills/static-analysis/SKILL.md +91 -0
- package/skills/static-analysis/skills/codeql/SKILL.md +315 -0
- package/skills/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/static-analysis/skills/semgrep/SKILL.md +337 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/testing-handbook-skills/.claude-plugin/plugin.json +8 -0
- package/skills/testing-handbook-skills/README.md +241 -0
- package/skills/testing-handbook-skills/SKILL.md +104 -0
- package/skills/testing-handbook-skills/scripts/pyproject.toml +8 -0
- package/skills/testing-handbook-skills/scripts/validate-skills.py +657 -0
- package/skills/testing-handbook-skills/skills/address-sanitizer/SKILL.md +341 -0
- package/skills/testing-handbook-skills/skills/aflpp/SKILL.md +640 -0
- package/skills/testing-handbook-skills/skills/atheris/SKILL.md +515 -0
- package/skills/testing-handbook-skills/skills/cargo-fuzz/SKILL.md +454 -0
- package/skills/testing-handbook-skills/skills/codeql/SKILL.md +549 -0
- package/skills/testing-handbook-skills/skills/constant-time-testing/SKILL.md +507 -0
- package/skills/testing-handbook-skills/skills/coverage-analysis/SKILL.md +607 -0
- package/skills/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md +297 -0
- package/skills/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/harness-writing/SKILL.md +614 -0
- package/skills/testing-handbook-skills/skills/libafl/SKILL.md +625 -0
- package/skills/testing-handbook-skills/skills/libfuzzer/SKILL.md +795 -0
- package/skills/testing-handbook-skills/skills/ossfuzz/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/ruzzy/SKILL.md +443 -0
- package/skills/testing-handbook-skills/skills/semgrep/SKILL.md +601 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md +372 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/agent-prompt.md +280 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/discovery.md +452 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/domain-skill.md +504 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/fuzzer-skill.md +454 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/technique-skill.md +527 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/tool-skill.md +366 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/testing.md +482 -0
- package/skills/testing-handbook-skills/skills/wycheproof/SKILL.md +533 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +135 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/variant-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/variant-analysis/README.md +41 -0
- package/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/commands/variants.md +23 -0
- package/skills/variant-analysis/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +54 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-differential-review
|
|
3
|
+
description: >
|
|
4
|
+
Performs security-focused differential review of code changes (PRs, commits, diffs).
|
|
5
|
+
Adapts analysis depth to codebase size, uses git history for context, calculates
|
|
6
|
+
blast radius, checks test coverage, and generates comprehensive markdown reports.
|
|
7
|
+
Automatically detects and prevents security regressions.
|
|
8
|
+
allowed-tools:
|
|
9
|
+
- Read
|
|
10
|
+
- Write
|
|
11
|
+
- Grep
|
|
12
|
+
- Glob
|
|
13
|
+
- Bash
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Differential Security Review
|
|
17
|
+
|
|
18
|
+
Security-focused code review for PRs, commits, and diffs.
|
|
19
|
+
|
|
20
|
+
## Core Principles
|
|
21
|
+
|
|
22
|
+
1. **Risk-First**: Focus on auth, crypto, value transfer, external calls
|
|
23
|
+
2. **Evidence-Based**: Every finding backed by git history, line numbers, attack scenarios
|
|
24
|
+
3. **Adaptive**: Scale to codebase size (SMALL/MEDIUM/LARGE)
|
|
25
|
+
4. **Honest**: Explicitly state coverage limits and confidence level
|
|
26
|
+
5. **Output-Driven**: Always generate comprehensive markdown report file
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Rationalizations (Do Not Skip)
|
|
31
|
+
|
|
32
|
+
| Rationalization | Why It's Wrong | Required Action |
|
|
33
|
+
|-----------------|----------------|-----------------|
|
|
34
|
+
| "Small PR, quick review" | Heartbleed was 2 lines | Classify by RISK, not size |
|
|
35
|
+
| "I know this codebase" | Familiarity breeds blind spots | Build explicit baseline context |
|
|
36
|
+
| "Git history takes too long" | History reveals regressions | Never skip Phase 1 |
|
|
37
|
+
| "Blast radius is obvious" | You'll miss transitive callers | Calculate quantitatively |
|
|
38
|
+
| "No tests = not my problem" | Missing tests = elevated risk rating | Flag in report, elevate severity |
|
|
39
|
+
| "Just a refactor, no security impact" | Refactors break invariants | Analyze as HIGH until proven LOW |
|
|
40
|
+
| "I'll explain verbally" | No artifact = findings lost | Always write report |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Reference
|
|
45
|
+
|
|
46
|
+
### Codebase Size Strategy
|
|
47
|
+
|
|
48
|
+
| Codebase Size | Strategy | Approach |
|
|
49
|
+
|---------------|----------|----------|
|
|
50
|
+
| SMALL (<20 files) | DEEP | Read all deps, full git blame |
|
|
51
|
+
| MEDIUM (20-200) | FOCUSED | 1-hop deps, priority files |
|
|
52
|
+
| LARGE (200+) | SURGICAL | Critical paths only |
|
|
53
|
+
|
|
54
|
+
### Risk Level Triggers
|
|
55
|
+
|
|
56
|
+
| Risk Level | Triggers |
|
|
57
|
+
|------------|----------|
|
|
58
|
+
| HIGH | Auth, crypto, external calls, value transfer, validation removal |
|
|
59
|
+
| MEDIUM | Business logic, state changes, new public APIs |
|
|
60
|
+
| LOW | Comments, tests, UI, logging |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Workflow Overview
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Pre-Analysis → Phase 0: Triage → Phase 1: Code Analysis → Phase 2: Test Coverage
|
|
68
|
+
↓ ↓ ↓ ↓
|
|
69
|
+
Phase 3: Blast Radius → Phase 4: Deep Context → Phase 5: Adversarial → Phase 6: Report
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Decision Tree
|
|
75
|
+
|
|
76
|
+
**Starting a review?**
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
├─ Need detailed phase-by-phase methodology?
|
|
80
|
+
│ └─ Read: methodology.md
|
|
81
|
+
│ (Pre-Analysis + Phases 0-4: triage, code analysis, test coverage, blast radius)
|
|
82
|
+
│
|
|
83
|
+
├─ Analyzing HIGH RISK change?
|
|
84
|
+
│ └─ Read: adversarial.md
|
|
85
|
+
│ (Phase 5: Attacker modeling, exploit scenarios, exploitability rating)
|
|
86
|
+
│
|
|
87
|
+
├─ Writing the final report?
|
|
88
|
+
│ └─ Read: reporting.md
|
|
89
|
+
│ (Phase 6: Report structure, templates, formatting guidelines)
|
|
90
|
+
│
|
|
91
|
+
├─ Looking for specific vulnerability patterns?
|
|
92
|
+
│ └─ Read: patterns.md
|
|
93
|
+
│ (Regressions, reentrancy, access control, overflow, etc.)
|
|
94
|
+
│
|
|
95
|
+
└─ Quick triage only?
|
|
96
|
+
└─ Use Quick Reference above, skip detailed docs
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Quality Checklist
|
|
102
|
+
|
|
103
|
+
Before delivering:
|
|
104
|
+
|
|
105
|
+
- [ ] All changed files analyzed
|
|
106
|
+
- [ ] Git blame on removed security code
|
|
107
|
+
- [ ] Blast radius calculated for HIGH risk
|
|
108
|
+
- [ ] Attack scenarios are concrete (not generic)
|
|
109
|
+
- [ ] Findings reference specific line numbers + commits
|
|
110
|
+
- [ ] Report file generated
|
|
111
|
+
- [ ] User notified with summary
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Integration
|
|
116
|
+
|
|
117
|
+
**audit-context-building skill:**
|
|
118
|
+
- Pre-Analysis: Build baseline context
|
|
119
|
+
- Phase 4: Deep context on HIGH RISK changes
|
|
120
|
+
|
|
121
|
+
**issue-writer skill:**
|
|
122
|
+
- Transform findings into formal audit reports
|
|
123
|
+
- Command: `issue-writer --input DIFFERENTIAL_REVIEW_REPORT.md --format audit-report`
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Example Usage
|
|
128
|
+
|
|
129
|
+
### Quick Triage (Small PR)
|
|
130
|
+
```
|
|
131
|
+
Input: 5 file PR, 2 HIGH RISK files
|
|
132
|
+
Strategy: Use Quick Reference
|
|
133
|
+
1. Classify risk level per file (2 HIGH, 3 LOW)
|
|
134
|
+
2. Focus on 2 HIGH files only
|
|
135
|
+
3. Git blame removed code
|
|
136
|
+
4. Generate minimal report
|
|
137
|
+
Time: ~30 minutes
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Standard Review (Medium Codebase)
|
|
141
|
+
```
|
|
142
|
+
Input: 80 files, 12 HIGH RISK changes
|
|
143
|
+
Strategy: FOCUSED (see methodology.md)
|
|
144
|
+
1. Full workflow on HIGH RISK files
|
|
145
|
+
2. Surface scan on MEDIUM
|
|
146
|
+
3. Skip LOW risk files
|
|
147
|
+
4. Complete report with all sections
|
|
148
|
+
Time: ~3-4 hours
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Deep Audit (Large, Critical Change)
|
|
152
|
+
```
|
|
153
|
+
Input: 450 files, auth system rewrite
|
|
154
|
+
Strategy: SURGICAL + audit-context-building
|
|
155
|
+
1. Baseline context with audit-context-building
|
|
156
|
+
2. Deep analysis on auth changes only
|
|
157
|
+
3. Blast radius analysis
|
|
158
|
+
4. Adversarial modeling
|
|
159
|
+
5. Comprehensive report
|
|
160
|
+
Time: ~6-8 hours
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## When NOT to Use This Skill
|
|
166
|
+
|
|
167
|
+
- **Greenfield code** (no baseline to compare)
|
|
168
|
+
- **Documentation-only changes** (no security impact)
|
|
169
|
+
- **Formatting/linting** (cosmetic changes)
|
|
170
|
+
- **User explicitly requests quick summary only** (they accept risk)
|
|
171
|
+
|
|
172
|
+
For these cases, use standard code review instead.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Red Flags (Stop and Investigate)
|
|
177
|
+
|
|
178
|
+
**Immediate escalation triggers:**
|
|
179
|
+
- Removed code from "security", "CVE", or "fix" commits
|
|
180
|
+
- Access control modifiers removed (onlyOwner, internal → external)
|
|
181
|
+
- Validation removed without replacement
|
|
182
|
+
- External calls added without checks
|
|
183
|
+
- High blast radius (50+ callers) + HIGH risk change
|
|
184
|
+
|
|
185
|
+
These patterns require adversarial analysis even in quick triage.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Tips for Best Results
|
|
190
|
+
|
|
191
|
+
**Do:**
|
|
192
|
+
- Start with git blame for removed code
|
|
193
|
+
- Calculate blast radius early to prioritize
|
|
194
|
+
- Generate concrete attack scenarios
|
|
195
|
+
- Reference specific line numbers and commits
|
|
196
|
+
- Be honest about coverage limitations
|
|
197
|
+
- Always generate the output file
|
|
198
|
+
|
|
199
|
+
**Don't:**
|
|
200
|
+
- Skip git history analysis
|
|
201
|
+
- Make generic findings without evidence
|
|
202
|
+
- Claim full analysis when time-limited
|
|
203
|
+
- Forget to check test coverage
|
|
204
|
+
- Miss high blast radius changes
|
|
205
|
+
- Output report only to chat (file required)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Supporting Documentation
|
|
210
|
+
|
|
211
|
+
- **[methodology.md](skills/differential-review/methodology.md)** - Detailed phase-by-phase workflow (Phases 0-4)
|
|
212
|
+
- **[adversarial.md](skills/differential-review/adversarial.md)** - Attacker modeling and exploit scenarios (Phase 5)
|
|
213
|
+
- **[reporting.md](skills/differential-review/reporting.md)** - Report structure and formatting (Phase 6)
|
|
214
|
+
- **[patterns.md](skills/differential-review/patterns.md)** - Common vulnerability patterns reference
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
**For first-time users:** Start with [methodology.md](skills/differential-review/methodology.md) to understand the complete workflow.
|
|
219
|
+
|
|
220
|
+
**For experienced users:** Use this page's Quick Reference and Decision Tree to navigate directly to needed content.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trailofbits:diff-review
|
|
3
|
+
description: Performs security-focused differential review of code changes
|
|
4
|
+
argument-hint: "<pr-url|commit-sha|diff-path> [--baseline <ref>]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Grep
|
|
9
|
+
- Glob
|
|
10
|
+
- Bash
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Differential Security Review
|
|
14
|
+
|
|
15
|
+
**Arguments:** $ARGUMENTS
|
|
16
|
+
|
|
17
|
+
Parse arguments:
|
|
18
|
+
1. **Target** (required): PR URL, commit SHA, or diff path
|
|
19
|
+
2. **Baseline** (optional): `--baseline <ref>` for comparison reference
|
|
20
|
+
|
|
21
|
+
Invoke the `differential-review` skill with these arguments for the full workflow.
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: differential-review
|
|
3
|
+
description: >
|
|
4
|
+
Performs security-focused differential review of code changes (PRs, commits, diffs).
|
|
5
|
+
Adapts analysis depth to codebase size, uses git history for context, calculates
|
|
6
|
+
blast radius, checks test coverage, and generates comprehensive markdown reports.
|
|
7
|
+
Automatically detects and prevents security regressions.
|
|
8
|
+
allowed-tools:
|
|
9
|
+
- Read
|
|
10
|
+
- Write
|
|
11
|
+
- Grep
|
|
12
|
+
- Glob
|
|
13
|
+
- Bash
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Differential Security Review
|
|
17
|
+
|
|
18
|
+
Security-focused code review for PRs, commits, and diffs.
|
|
19
|
+
|
|
20
|
+
## Core Principles
|
|
21
|
+
|
|
22
|
+
1. **Risk-First**: Focus on auth, crypto, value transfer, external calls
|
|
23
|
+
2. **Evidence-Based**: Every finding backed by git history, line numbers, attack scenarios
|
|
24
|
+
3. **Adaptive**: Scale to codebase size (SMALL/MEDIUM/LARGE)
|
|
25
|
+
4. **Honest**: Explicitly state coverage limits and confidence level
|
|
26
|
+
5. **Output-Driven**: Always generate comprehensive markdown report file
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Rationalizations (Do Not Skip)
|
|
31
|
+
|
|
32
|
+
| Rationalization | Why It's Wrong | Required Action |
|
|
33
|
+
|-----------------|----------------|-----------------|
|
|
34
|
+
| "Small PR, quick review" | Heartbleed was 2 lines | Classify by RISK, not size |
|
|
35
|
+
| "I know this codebase" | Familiarity breeds blind spots | Build explicit baseline context |
|
|
36
|
+
| "Git history takes too long" | History reveals regressions | Never skip Phase 1 |
|
|
37
|
+
| "Blast radius is obvious" | You'll miss transitive callers | Calculate quantitatively |
|
|
38
|
+
| "No tests = not my problem" | Missing tests = elevated risk rating | Flag in report, elevate severity |
|
|
39
|
+
| "Just a refactor, no security impact" | Refactors break invariants | Analyze as HIGH until proven LOW |
|
|
40
|
+
| "I'll explain verbally" | No artifact = findings lost | Always write report |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Reference
|
|
45
|
+
|
|
46
|
+
### Codebase Size Strategy
|
|
47
|
+
|
|
48
|
+
| Codebase Size | Strategy | Approach |
|
|
49
|
+
|---------------|----------|----------|
|
|
50
|
+
| SMALL (<20 files) | DEEP | Read all deps, full git blame |
|
|
51
|
+
| MEDIUM (20-200) | FOCUSED | 1-hop deps, priority files |
|
|
52
|
+
| LARGE (200+) | SURGICAL | Critical paths only |
|
|
53
|
+
|
|
54
|
+
### Risk Level Triggers
|
|
55
|
+
|
|
56
|
+
| Risk Level | Triggers |
|
|
57
|
+
|------------|----------|
|
|
58
|
+
| HIGH | Auth, crypto, external calls, value transfer, validation removal |
|
|
59
|
+
| MEDIUM | Business logic, state changes, new public APIs |
|
|
60
|
+
| LOW | Comments, tests, UI, logging |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Workflow Overview
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Pre-Analysis → Phase 0: Triage → Phase 1: Code Analysis → Phase 2: Test Coverage
|
|
68
|
+
↓ ↓ ↓ ↓
|
|
69
|
+
Phase 3: Blast Radius → Phase 4: Deep Context → Phase 5: Adversarial → Phase 6: Report
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Decision Tree
|
|
75
|
+
|
|
76
|
+
**Starting a review?**
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
├─ Need detailed phase-by-phase methodology?
|
|
80
|
+
│ └─ Read: methodology.md
|
|
81
|
+
│ (Pre-Analysis + Phases 0-4: triage, code analysis, test coverage, blast radius)
|
|
82
|
+
│
|
|
83
|
+
├─ Analyzing HIGH RISK change?
|
|
84
|
+
│ └─ Read: adversarial.md
|
|
85
|
+
│ (Phase 5: Attacker modeling, exploit scenarios, exploitability rating)
|
|
86
|
+
│
|
|
87
|
+
├─ Writing the final report?
|
|
88
|
+
│ └─ Read: reporting.md
|
|
89
|
+
│ (Phase 6: Report structure, templates, formatting guidelines)
|
|
90
|
+
│
|
|
91
|
+
├─ Looking for specific vulnerability patterns?
|
|
92
|
+
│ └─ Read: patterns.md
|
|
93
|
+
│ (Regressions, reentrancy, access control, overflow, etc.)
|
|
94
|
+
│
|
|
95
|
+
└─ Quick triage only?
|
|
96
|
+
└─ Use Quick Reference above, skip detailed docs
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Quality Checklist
|
|
102
|
+
|
|
103
|
+
Before delivering:
|
|
104
|
+
|
|
105
|
+
- [ ] All changed files analyzed
|
|
106
|
+
- [ ] Git blame on removed security code
|
|
107
|
+
- [ ] Blast radius calculated for HIGH risk
|
|
108
|
+
- [ ] Attack scenarios are concrete (not generic)
|
|
109
|
+
- [ ] Findings reference specific line numbers + commits
|
|
110
|
+
- [ ] Report file generated
|
|
111
|
+
- [ ] User notified with summary
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Integration
|
|
116
|
+
|
|
117
|
+
**audit-context-building skill:**
|
|
118
|
+
- Pre-Analysis: Build baseline context
|
|
119
|
+
- Phase 4: Deep context on HIGH RISK changes
|
|
120
|
+
|
|
121
|
+
**issue-writer skill:**
|
|
122
|
+
- Transform findings into formal audit reports
|
|
123
|
+
- Command: `issue-writer --input DIFFERENTIAL_REVIEW_REPORT.md --format audit-report`
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Example Usage
|
|
128
|
+
|
|
129
|
+
### Quick Triage (Small PR)
|
|
130
|
+
```
|
|
131
|
+
Input: 5 file PR, 2 HIGH RISK files
|
|
132
|
+
Strategy: Use Quick Reference
|
|
133
|
+
1. Classify risk level per file (2 HIGH, 3 LOW)
|
|
134
|
+
2. Focus on 2 HIGH files only
|
|
135
|
+
3. Git blame removed code
|
|
136
|
+
4. Generate minimal report
|
|
137
|
+
Time: ~30 minutes
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Standard Review (Medium Codebase)
|
|
141
|
+
```
|
|
142
|
+
Input: 80 files, 12 HIGH RISK changes
|
|
143
|
+
Strategy: FOCUSED (see methodology.md)
|
|
144
|
+
1. Full workflow on HIGH RISK files
|
|
145
|
+
2. Surface scan on MEDIUM
|
|
146
|
+
3. Skip LOW risk files
|
|
147
|
+
4. Complete report with all sections
|
|
148
|
+
Time: ~3-4 hours
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Deep Audit (Large, Critical Change)
|
|
152
|
+
```
|
|
153
|
+
Input: 450 files, auth system rewrite
|
|
154
|
+
Strategy: SURGICAL + audit-context-building
|
|
155
|
+
1. Baseline context with audit-context-building
|
|
156
|
+
2. Deep analysis on auth changes only
|
|
157
|
+
3. Blast radius analysis
|
|
158
|
+
4. Adversarial modeling
|
|
159
|
+
5. Comprehensive report
|
|
160
|
+
Time: ~6-8 hours
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## When NOT to Use This Skill
|
|
166
|
+
|
|
167
|
+
- **Greenfield code** (no baseline to compare)
|
|
168
|
+
- **Documentation-only changes** (no security impact)
|
|
169
|
+
- **Formatting/linting** (cosmetic changes)
|
|
170
|
+
- **User explicitly requests quick summary only** (they accept risk)
|
|
171
|
+
|
|
172
|
+
For these cases, use standard code review instead.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Red Flags (Stop and Investigate)
|
|
177
|
+
|
|
178
|
+
**Immediate escalation triggers:**
|
|
179
|
+
- Removed code from "security", "CVE", or "fix" commits
|
|
180
|
+
- Access control modifiers removed (onlyOwner, internal → external)
|
|
181
|
+
- Validation removed without replacement
|
|
182
|
+
- External calls added without checks
|
|
183
|
+
- High blast radius (50+ callers) + HIGH risk change
|
|
184
|
+
|
|
185
|
+
These patterns require adversarial analysis even in quick triage.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Tips for Best Results
|
|
190
|
+
|
|
191
|
+
**Do:**
|
|
192
|
+
- Start with git blame for removed code
|
|
193
|
+
- Calculate blast radius early to prioritize
|
|
194
|
+
- Generate concrete attack scenarios
|
|
195
|
+
- Reference specific line numbers and commits
|
|
196
|
+
- Be honest about coverage limitations
|
|
197
|
+
- Always generate the output file
|
|
198
|
+
|
|
199
|
+
**Don't:**
|
|
200
|
+
- Skip git history analysis
|
|
201
|
+
- Make generic findings without evidence
|
|
202
|
+
- Claim full analysis when time-limited
|
|
203
|
+
- Forget to check test coverage
|
|
204
|
+
- Miss high blast radius changes
|
|
205
|
+
- Output report only to chat (file required)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Supporting Documentation
|
|
210
|
+
|
|
211
|
+
- **[methodology.md](methodology.md)** - Detailed phase-by-phase workflow (Phases 0-4)
|
|
212
|
+
- **[adversarial.md](adversarial.md)** - Attacker modeling and exploit scenarios (Phase 5)
|
|
213
|
+
- **[reporting.md](reporting.md)** - Report structure and formatting (Phase 6)
|
|
214
|
+
- **[patterns.md](patterns.md)** - Common vulnerability patterns reference
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
**For first-time users:** Start with [methodology.md](methodology.md) to understand the complete workflow.
|
|
219
|
+
|
|
220
|
+
**For experienced users:** Use this page's Quick Reference and Decision Tree to navigate directly to needed content.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Adversarial Vulnerability Analysis (Phase 5)
|
|
2
|
+
|
|
3
|
+
Structured methodology for finding vulnerabilities through attacker modeling.
|
|
4
|
+
|
|
5
|
+
**When to use:** After completing deep context analysis (Phase 4), apply this to all HIGH RISK changes.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Define Specific Attacker Model
|
|
10
|
+
|
|
11
|
+
**WHO is the attacker?**
|
|
12
|
+
- Unauthenticated external user
|
|
13
|
+
- Authenticated regular user
|
|
14
|
+
- Malicious administrator
|
|
15
|
+
- Compromised contract/service
|
|
16
|
+
- Front-runner/MEV bot
|
|
17
|
+
|
|
18
|
+
**WHAT access/privileges do they have?**
|
|
19
|
+
- Public API access only
|
|
20
|
+
- Authenticated user role
|
|
21
|
+
- Specific permissions/tokens
|
|
22
|
+
- Contract call capabilities
|
|
23
|
+
|
|
24
|
+
**WHERE do they interact with the system?**
|
|
25
|
+
- Specific HTTP endpoints
|
|
26
|
+
- Smart contract functions
|
|
27
|
+
- RPC interfaces
|
|
28
|
+
- External APIs
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2. Identify Concrete Attack Vectors
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
ENTRY POINT: [Exact function/endpoint attacker can access]
|
|
36
|
+
|
|
37
|
+
ATTACK SEQUENCE:
|
|
38
|
+
1. [Specific API call/transaction with parameters]
|
|
39
|
+
2. [How this reaches the vulnerable code]
|
|
40
|
+
3. [What happens in the vulnerable code]
|
|
41
|
+
4. [Impact achieved]
|
|
42
|
+
|
|
43
|
+
PROOF OF ACCESSIBILITY:
|
|
44
|
+
- Show the function is public/external
|
|
45
|
+
- Demonstrate attacker has required permissions
|
|
46
|
+
- Prove attack path exists through actual interfaces
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. Rate Realistic Exploitability
|
|
52
|
+
|
|
53
|
+
**EASY:** Exploitable via public APIs with no special privileges
|
|
54
|
+
- Single transaction/call
|
|
55
|
+
- Common user access level
|
|
56
|
+
- No complex conditions required
|
|
57
|
+
|
|
58
|
+
**MEDIUM:** Requires specific conditions or elevated privileges
|
|
59
|
+
- Multiple steps or timing requirements
|
|
60
|
+
- Elevated but obtainable privileges
|
|
61
|
+
- Specific system state needed
|
|
62
|
+
|
|
63
|
+
**HARD:** Requires privileged access or rare conditions
|
|
64
|
+
- Admin/owner privileges needed
|
|
65
|
+
- Rare edge case conditions
|
|
66
|
+
- Significant resources required
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 4. Build Complete Exploit Scenario
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
ATTACKER STARTING POSITION:
|
|
74
|
+
[What the attacker has at the beginning]
|
|
75
|
+
|
|
76
|
+
STEP-BY-STEP EXPLOITATION:
|
|
77
|
+
Step 1: [Concrete action through accessible interface]
|
|
78
|
+
- Command: [Exact call/request]
|
|
79
|
+
- Parameters: [Specific values]
|
|
80
|
+
- Expected result: [What happens]
|
|
81
|
+
|
|
82
|
+
Step 2: [Next action]
|
|
83
|
+
- Command: [Exact call/request]
|
|
84
|
+
- Why this works: [Reference to code change]
|
|
85
|
+
- System state change: [What changed]
|
|
86
|
+
|
|
87
|
+
Step 3: [Final impact]
|
|
88
|
+
- Result: [Concrete harm achieved]
|
|
89
|
+
- Evidence: [How to verify impact]
|
|
90
|
+
|
|
91
|
+
CONCRETE IMPACT:
|
|
92
|
+
[Specific, measurable impact - not "could cause issues"]
|
|
93
|
+
- Exact amount of funds drained
|
|
94
|
+
- Specific privileges escalated
|
|
95
|
+
- Particular data exposed
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 5. Cross-Reference with Baseline Context
|
|
101
|
+
|
|
102
|
+
From baseline analysis (see [methodology.md](methodology.md#pre-analysis-baseline-context-building)), check:
|
|
103
|
+
- Does this violate a system-wide invariant?
|
|
104
|
+
- Does this break a trust boundary?
|
|
105
|
+
- Does this bypass a validation pattern?
|
|
106
|
+
- Is this a regression of a previous fix?
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Vulnerability Report Template
|
|
111
|
+
|
|
112
|
+
Generate this for each finding:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## [SEVERITY] Vulnerability Title
|
|
116
|
+
|
|
117
|
+
**Attacker Model:**
|
|
118
|
+
- WHO: [Specific attacker type]
|
|
119
|
+
- ACCESS: [Exact privileges]
|
|
120
|
+
- INTERFACE: [Specific entry point]
|
|
121
|
+
|
|
122
|
+
**Attack Vector:**
|
|
123
|
+
[Step-by-step exploit through accessible interfaces]
|
|
124
|
+
|
|
125
|
+
**Exploitability:** EASY/MEDIUM/HARD
|
|
126
|
+
**Justification:** [Why this rating]
|
|
127
|
+
|
|
128
|
+
**Concrete Impact:**
|
|
129
|
+
[Specific, measurable harm - not theoretical]
|
|
130
|
+
|
|
131
|
+
**Proof of Concept:**
|
|
132
|
+
```code
|
|
133
|
+
// Exact code to reproduce
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Root Cause:**
|
|
137
|
+
[Reference specific code change at file.sol:L123]
|
|
138
|
+
|
|
139
|
+
**Blast Radius:** [N callers affected]
|
|
140
|
+
**Baseline Violation:** [Which invariant/pattern broken]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Example: Complete Adversarial Analysis
|
|
146
|
+
|
|
147
|
+
**Change:** Removed `require(amount > 0)` check from `withdraw()` function
|
|
148
|
+
|
|
149
|
+
### 1. Attacker Model
|
|
150
|
+
- **WHO:** Unauthenticated external user
|
|
151
|
+
- **ACCESS:** Can call public contract functions
|
|
152
|
+
- **INTERFACE:** `withdraw(uint256 amount)` at 0x1234...
|
|
153
|
+
|
|
154
|
+
### 2. Attack Vector
|
|
155
|
+
**ENTRY POINT:** `withdraw(0)`
|
|
156
|
+
|
|
157
|
+
**ATTACK SEQUENCE:**
|
|
158
|
+
1. Call `withdraw(0)` from attacker address
|
|
159
|
+
2. Code bypasses amount check (removed)
|
|
160
|
+
3. Withdraw event emitted with 0 amount
|
|
161
|
+
4. Accounting updated incorrectly
|
|
162
|
+
|
|
163
|
+
**PROOF:** Function is `external`, no auth required
|
|
164
|
+
|
|
165
|
+
### 3. Exploitability
|
|
166
|
+
**RATING:** EASY
|
|
167
|
+
- Single transaction
|
|
168
|
+
- Public function
|
|
169
|
+
- No special state required
|
|
170
|
+
|
|
171
|
+
### 4. Exploit Scenario
|
|
172
|
+
**ATTACKER POSITION:** Has user account with 0 balance
|
|
173
|
+
|
|
174
|
+
**EXPLOITATION:**
|
|
175
|
+
```solidity
|
|
176
|
+
Step 1: attacker.withdraw(0)
|
|
177
|
+
- Passes removed validation
|
|
178
|
+
- Emits Withdraw(user, 0)
|
|
179
|
+
- Updates withdrawnAmount[user] += 0
|
|
180
|
+
|
|
181
|
+
Step 2: Off-chain indexer sees Withdraw event
|
|
182
|
+
- Credits attacker for 0 withdrawal
|
|
183
|
+
- But accounting thinks withdrawal happened
|
|
184
|
+
|
|
185
|
+
Step 3: Accounting mismatch exploited
|
|
186
|
+
- Total supply decremented
|
|
187
|
+
- User balance not changed
|
|
188
|
+
- System invariants broken
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**IMPACT:**
|
|
192
|
+
- Protocol accounting corrupted
|
|
193
|
+
- Can be used to manipulate LP calculations
|
|
194
|
+
- Estimated $50K impact on pool prices
|
|
195
|
+
|
|
196
|
+
### 5. Baseline Violation
|
|
197
|
+
- Violates invariant: "All withdrawals must transfer non-zero value"
|
|
198
|
+
- Breaks validation pattern: Amount checks present in all other value transfers
|
|
199
|
+
- Regression: Check added in commit abc123 "Fix zero-amount exploit"
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
**Next:** Document all findings in final report (see [reporting.md](reporting.md))
|