web3skill 0.1.0
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/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/archives/web3-audit-orchestrator.skill +0 -0
- package/dist/archives/web3-audit-reporting.skill +0 -0
- package/dist/archives/web3-fuzzing-and-invariants.skill +0 -0
- package/dist/archives/web3-native-operator.skill +0 -0
- package/dist/archives/web3-repo-heuristics.skill +0 -0
- package/dist/archives/web3-research-and-market-intel.skill +0 -0
- package/dist/archives/web3-risk-gate.skill +0 -0
- package/dist/archives/web3-service-orchestrator.skill +0 -0
- package/dist/archives/web3-static-analysis-runner.skill +0 -0
- package/dist/archives/web3-trace-and-state-analysis.skill +0 -0
- package/dist/archives/web3-transaction-simulator.skill +0 -0
- package/dist/archives/web3-wallet-operator.skill +0 -0
- package/dist/manifest.json +170 -0
- package/dist/skills/web3-audit-orchestrator/SKILL.md +79 -0
- package/dist/skills/web3-audit-orchestrator/references/ADAPTER_CONSUMPTION_MAP.md +15 -0
- package/dist/skills/web3-audit-orchestrator/references/OUTPUT_TEMPLATE.md +52 -0
- package/dist/skills/web3-audit-orchestrator/references/REVIEW_STATE_MACHINE.md +25 -0
- package/dist/skills/web3-audit-orchestrator/scripts/render_audit_review.py +95 -0
- package/dist/skills/web3-audit-reporting/SKILL.md +77 -0
- package/dist/skills/web3-audit-reporting/references/FINDING_TEMPLATE.md +54 -0
- package/dist/skills/web3-audit-reporting/references/REPORT_TEMPLATE.md +58 -0
- package/dist/skills/web3-audit-reporting/references/RETEST_TEMPLATE.md +35 -0
- package/dist/skills/web3-audit-reporting/references/SEVERITY_RUBRIC.md +75 -0
- package/dist/skills/web3-fuzzing-and-invariants/SKILL.md +68 -0
- package/dist/skills/web3-fuzzing-and-invariants/references/ADAPTER_CONSUMPTION_MAP.md +14 -0
- package/dist/skills/web3-fuzzing-and-invariants/references/OUTPUT_TEMPLATE.md +40 -0
- package/dist/skills/web3-fuzzing-and-invariants/references/READINESS_AND_FAILURES.md +25 -0
- package/dist/skills/web3-fuzzing-and-invariants/scripts/render_fuzz_summary.py +64 -0
- package/dist/skills/web3-native-operator/SKILL.md +218 -0
- package/dist/skills/web3-native-operator/references/EXECUTION_BUNDLE_TEMPLATE.md +47 -0
- package/dist/skills/web3-native-operator/references/OPERATOR_BUNDLE_TEMPLATE.md +39 -0
- package/dist/skills/web3-native-operator/references/POSTTRADE_FOLLOWUP_BUNDLE_TEMPLATE.md +35 -0
- package/dist/skills/web3-native-operator/references/POSTTRADE_WATCH_TEMPLATE.md +34 -0
- package/dist/skills/web3-native-operator/references/PRETRADE_PACKET_TEMPLATE.md +34 -0
- package/dist/skills/web3-native-operator/references/ROUTE_RECIPES.md +140 -0
- package/dist/skills/web3-native-operator/references/ROUTING_STATE_MACHINE.md +73 -0
- package/dist/skills/web3-native-operator/references/WATCH_CRON_REQUEST_TEMPLATE.md +26 -0
- package/dist/skills/web3-native-operator/references/WATCH_FOLLOWUP_BUNDLE_TEMPLATE.md +35 -0
- package/dist/skills/web3-native-operator/references/WATCH_HEARTBEAT_TEMPLATE.md +31 -0
- package/dist/skills/web3-native-operator/scripts/apply_followup_bundle_to_heartbeat.py +118 -0
- package/dist/skills/web3-native-operator/scripts/render_execution_bundle.py +259 -0
- package/dist/skills/web3-native-operator/scripts/render_operator_bundle.py +800 -0
- package/dist/skills/web3-native-operator/scripts/render_posttrade_followup_bundle.py +118 -0
- package/dist/skills/web3-native-operator/scripts/render_posttrade_watch_status.py +125 -0
- package/dist/skills/web3-native-operator/scripts/render_pretrade_packet.py +205 -0
- package/dist/skills/web3-native-operator/scripts/render_watch_cron_request.py +88 -0
- package/dist/skills/web3-native-operator/scripts/render_watch_followup_bundle.py +118 -0
- package/dist/skills/web3-native-operator/scripts/render_watch_heartbeat.py +52 -0
- package/dist/skills/web3-repo-heuristics/SKILL.md +37 -0
- package/dist/skills/web3-repo-heuristics/references/FOUNDRY.md +49 -0
- package/dist/skills/web3-repo-heuristics/references/HARDHAT.md +47 -0
- package/dist/skills/web3-repo-heuristics/references/VYPER.md +26 -0
- package/dist/skills/web3-research-and-market-intel/SKILL.md +138 -0
- package/dist/skills/web3-research-and-market-intel/references/ADAPTER_CONSUMPTION_MAP.md +66 -0
- package/dist/skills/web3-research-and-market-intel/references/EVIDENCE_QUALITY.md +27 -0
- package/dist/skills/web3-research-and-market-intel/references/OUTPUT_TEMPLATE.md +37 -0
- package/dist/skills/web3-research-and-market-intel/references/PORTFOLIO_STATUS_TEMPLATE.md +51 -0
- package/dist/skills/web3-research-and-market-intel/references/WATCH_STATUS_TEMPLATE.md +39 -0
- package/dist/skills/web3-research-and-market-intel/scripts/render_portfolio_status.py +85 -0
- package/dist/skills/web3-research-and-market-intel/scripts/render_research_brief.py +58 -0
- package/dist/skills/web3-research-and-market-intel/scripts/render_watch_status.py +70 -0
- package/dist/skills/web3-risk-gate/SKILL.md +100 -0
- package/dist/skills/web3-risk-gate/references/OUTPUT_TEMPLATE.md +72 -0
- package/dist/skills/web3-risk-gate/references/SIGNAL_TAXONOMY.md +34 -0
- package/dist/skills/web3-risk-gate/scripts/merge_risk_gate_blocks.py +189 -0
- package/dist/skills/web3-service-orchestrator/SKILL.md +34 -0
- package/dist/skills/web3-static-analysis-runner/SKILL.md +76 -0
- package/dist/skills/web3-static-analysis-runner/references/ADAPTER_CONSUMPTION_MAP.md +13 -0
- package/dist/skills/web3-static-analysis-runner/references/OUTPUT_TEMPLATE.md +45 -0
- package/dist/skills/web3-static-analysis-runner/references/TRIAGE_BUCKETS.md +16 -0
- package/dist/skills/web3-static-analysis-runner/scripts/render_static_analysis_summary.py +64 -0
- package/dist/skills/web3-trace-and-state-analysis/SKILL.md +74 -0
- package/dist/skills/web3-trace-and-state-analysis/references/ADAPTER_CONSUMPTION_MAP.md +27 -0
- package/dist/skills/web3-trace-and-state-analysis/references/OUTPUT_TEMPLATE.md +63 -0
- package/dist/skills/web3-trace-and-state-analysis/references/TRACE_BACKEND_PREFLIGHT.md +47 -0
- package/dist/skills/web3-trace-and-state-analysis/scripts/render_trace_summary.py +99 -0
- package/dist/skills/web3-transaction-simulator/SKILL.md +83 -0
- package/dist/skills/web3-transaction-simulator/references/OUTPUT_TEMPLATE.md +86 -0
- package/dist/skills/web3-transaction-simulator/references/STATUS_AND_FAILURES.md +49 -0
- package/dist/skills/web3-transaction-simulator/scripts/merge_simulation_blocks.py +198 -0
- package/dist/skills/web3-wallet-operator/SKILL.md +52 -0
- package/dist/skills/web3-wallet-operator/references/ACTION_RECIPES.md +56 -0
- package/dist/skills/web3-wallet-operator/references/OUTPUT_TEMPLATE.md +43 -0
- package/dist/skills/web3-wallet-operator/scripts/render_wallet_operation_plan.py +101 -0
- package/index.js +50 -0
- package/package.json +36 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web3-audit-reporting
|
|
3
|
+
description: Produce high-signal Web3 audit deliverables with scope, trust boundaries, evidence-backed findings, severity calibration, remediation, and retest conclusions. Use when the user wants a smart contract audit report, finding writeup, severity review, contest submission, fix validation, or consolidated security deliverable.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web3 Audit Reporting
|
|
7
|
+
|
|
8
|
+
Use this skill for audit-grade output, not casual review notes.
|
|
9
|
+
|
|
10
|
+
## Mode Selection
|
|
11
|
+
|
|
12
|
+
- Full report or consolidated review:
|
|
13
|
+
- read `references/REPORT_TEMPLATE.md`
|
|
14
|
+
- Single finding or contest submission:
|
|
15
|
+
- read `references/FINDING_TEMPLATE.md`
|
|
16
|
+
- Fix validation or retest:
|
|
17
|
+
- read `references/RETEST_TEMPLATE.md`
|
|
18
|
+
- Severity dispute or calibration:
|
|
19
|
+
- read `references/SEVERITY_RUBRIC.md`
|
|
20
|
+
|
|
21
|
+
## Non-Negotiable Gates
|
|
22
|
+
|
|
23
|
+
- Do not promote a suspicion into a finding until you can state:
|
|
24
|
+
- attacker
|
|
25
|
+
- preconditions
|
|
26
|
+
- vulnerable entry point and code path
|
|
27
|
+
- broken invariant or trust assumption
|
|
28
|
+
- realistic impact on users, funds, control, or liveness
|
|
29
|
+
- Every finding must cite affected files, functions, and line references when possible.
|
|
30
|
+
- Separate confirmed findings from dismissed candidates and open questions.
|
|
31
|
+
- If exploitation requires a malicious privileged role, classify it as a trust or centralization issue unless the user explicitly asked for admin-abuse review.
|
|
32
|
+
- If severity is unclear, lower confidence before inflating severity.
|
|
33
|
+
|
|
34
|
+
## Delivery Workflow
|
|
35
|
+
|
|
36
|
+
1. Lock the review context first:
|
|
37
|
+
- target
|
|
38
|
+
- commit or snapshot
|
|
39
|
+
- chain or deployment context
|
|
40
|
+
- in-scope and out-of-scope components
|
|
41
|
+
2. Build the protocol model before writing findings:
|
|
42
|
+
- assets at risk
|
|
43
|
+
- roles and upgrade paths
|
|
44
|
+
- external dependencies
|
|
45
|
+
- core invariants
|
|
46
|
+
- critical user flows
|
|
47
|
+
3. Run a falsification pass on every candidate:
|
|
48
|
+
- search for guards, bounds, config assumptions, opposing code paths, and documented intent
|
|
49
|
+
- discard anything that fails under realistic conditions
|
|
50
|
+
4. Consolidate by root cause:
|
|
51
|
+
- deduplicate overlapping tool output or parallel notes
|
|
52
|
+
- keep the highest-confidence version
|
|
53
|
+
- do not count the same bug multiple times unless the impacts are materially different
|
|
54
|
+
5. Write findings in descending severity while keeping confidence explicit.
|
|
55
|
+
6. End with remediation status, retest status, and unresolved risks.
|
|
56
|
+
|
|
57
|
+
## Writing Rules
|
|
58
|
+
|
|
59
|
+
- Lead with exploit path and user impact, not generic best-practice language.
|
|
60
|
+
- Explain why the issue is exploitable under the stated assumptions.
|
|
61
|
+
- State what was actually verified:
|
|
62
|
+
- manual reasoning
|
|
63
|
+
- test or PoC
|
|
64
|
+
- static analysis
|
|
65
|
+
- onchain evidence
|
|
66
|
+
- State what was not verified:
|
|
67
|
+
- missing deployment data
|
|
68
|
+
- unrun tests
|
|
69
|
+
- assumed config or oracle behavior
|
|
70
|
+
- When no issue is confirmed, say so directly and list residual risks or coverage gaps.
|
|
71
|
+
|
|
72
|
+
## Escalation
|
|
73
|
+
|
|
74
|
+
- Read `references/SEVERITY_RUBRIC.md` before assigning severity in any nontrivial case.
|
|
75
|
+
- Read `references/FINDING_TEMPLATE.md` before writing any individual finding.
|
|
76
|
+
- Read `references/REPORT_TEMPLATE.md` before producing a full audit report or merged review.
|
|
77
|
+
- Read `references/RETEST_TEMPLATE.md` when validating a claimed fix or protocol upgrade.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Finding Template
|
|
2
|
+
|
|
3
|
+
## [H-1] Loss of Funds via Broken Accounting in `Feature`
|
|
4
|
+
|
|
5
|
+
### Snapshot
|
|
6
|
+
|
|
7
|
+
- Severity:
|
|
8
|
+
- Confidence:
|
|
9
|
+
- Status: confirmed / likely / dismissed / needs retest
|
|
10
|
+
- Category:
|
|
11
|
+
- Source: manual / tool / chain / mixed
|
|
12
|
+
- Affected files:
|
|
13
|
+
- Affected functions:
|
|
14
|
+
|
|
15
|
+
### User and Protocol Impact
|
|
16
|
+
|
|
17
|
+
- Broken invariant or trust assumption:
|
|
18
|
+
- Attacker capability:
|
|
19
|
+
- Preconditions:
|
|
20
|
+
- Realistic impact:
|
|
21
|
+
- Why this matters now:
|
|
22
|
+
|
|
23
|
+
### Technical Path
|
|
24
|
+
|
|
25
|
+
1. Entry point:
|
|
26
|
+
2. Relevant state or accounting assumption:
|
|
27
|
+
3. Manipulation or external-call step:
|
|
28
|
+
4. Missing check, stale state, or unsafe transition:
|
|
29
|
+
5. Resulting loss, lock, control change, or liveness failure:
|
|
30
|
+
|
|
31
|
+
### Evidence
|
|
32
|
+
|
|
33
|
+
- Code references:
|
|
34
|
+
- Tool or trace evidence:
|
|
35
|
+
- Test, PoC, simulation, or calldata evidence:
|
|
36
|
+
- Chain or deployment evidence:
|
|
37
|
+
|
|
38
|
+
### Falsification Checks
|
|
39
|
+
|
|
40
|
+
- What was checked to disprove the issue:
|
|
41
|
+
- Why those checks did not save the system:
|
|
42
|
+
- Remaining uncertainty:
|
|
43
|
+
|
|
44
|
+
### Remediation
|
|
45
|
+
|
|
46
|
+
- Primary fix:
|
|
47
|
+
- Defense in depth:
|
|
48
|
+
- Verification to rerun:
|
|
49
|
+
|
|
50
|
+
### Retest Notes
|
|
51
|
+
|
|
52
|
+
- Claimed fix:
|
|
53
|
+
- Retest status:
|
|
54
|
+
- Residual risk:
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Web3 Security Review Report
|
|
2
|
+
|
|
3
|
+
## Review Context
|
|
4
|
+
|
|
5
|
+
- Target:
|
|
6
|
+
- Commit, tag, or snapshot:
|
|
7
|
+
- Review type: full audit / focused review / diff review / contest triage / post-fix retest
|
|
8
|
+
- Review date:
|
|
9
|
+
- Reviewer:
|
|
10
|
+
- Chains or environments considered:
|
|
11
|
+
- In scope:
|
|
12
|
+
- Out of scope:
|
|
13
|
+
|
|
14
|
+
## Protocol Model
|
|
15
|
+
|
|
16
|
+
- Protocol purpose:
|
|
17
|
+
- Assets at risk:
|
|
18
|
+
- Roles and privileged actors:
|
|
19
|
+
- Upgradeability, pause, or emergency powers:
|
|
20
|
+
- External dependencies:
|
|
21
|
+
- Core invariants:
|
|
22
|
+
- Critical user flows:
|
|
23
|
+
|
|
24
|
+
## Methodology
|
|
25
|
+
|
|
26
|
+
- Manual review:
|
|
27
|
+
- Static analysis:
|
|
28
|
+
- Dynamic testing, fuzzing, or invariants:
|
|
29
|
+
- Onchain or config validation:
|
|
30
|
+
- Candidate issues dismissed during triage:
|
|
31
|
+
|
|
32
|
+
## Findings Overview
|
|
33
|
+
|
|
34
|
+
| ID | Severity | Confidence | Status | Title | Affected area |
|
|
35
|
+
| --- | --- | --- | --- | --- | --- |
|
|
36
|
+
| H-1 | High | Medium | Confirmed | Example title | Core vault accounting |
|
|
37
|
+
|
|
38
|
+
If no issue is confirmed, say so explicitly here and list the residual risks or validation gaps.
|
|
39
|
+
|
|
40
|
+
## Detailed Findings
|
|
41
|
+
|
|
42
|
+
Use `FINDING_TEMPLATE.md` for each confirmed issue.
|
|
43
|
+
|
|
44
|
+
## Remediation and Retest Summary
|
|
45
|
+
|
|
46
|
+
| ID | Claimed fix | Retest status | Notes |
|
|
47
|
+
| --- | --- | --- | --- |
|
|
48
|
+
| H-1 | Update accounting before transfer | Partially fixed | Cross-function path still open |
|
|
49
|
+
|
|
50
|
+
## Residual Risks and Open Questions
|
|
51
|
+
|
|
52
|
+
-
|
|
53
|
+
|
|
54
|
+
## Appendix
|
|
55
|
+
|
|
56
|
+
- Commands and tools run
|
|
57
|
+
- Assumptions and missing data
|
|
58
|
+
- Addresses, deployments, or chain context
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Retest Template
|
|
2
|
+
|
|
3
|
+
## Retest Context
|
|
4
|
+
|
|
5
|
+
- Finding ID or title:
|
|
6
|
+
- Claimed fix commit or patch:
|
|
7
|
+
- Retest date:
|
|
8
|
+
- Retest status:
|
|
9
|
+
|
|
10
|
+
## Intended Delta
|
|
11
|
+
|
|
12
|
+
- Files changed:
|
|
13
|
+
- Root cause supposedly removed:
|
|
14
|
+
- New trust assumptions introduced:
|
|
15
|
+
|
|
16
|
+
## Validation Performed
|
|
17
|
+
|
|
18
|
+
- Build or compile:
|
|
19
|
+
- Targeted unit tests:
|
|
20
|
+
- Adversarial or PoC replay:
|
|
21
|
+
- Invariant or fuzz checks:
|
|
22
|
+
- Static analysis rerun:
|
|
23
|
+
- Deployment or config validation:
|
|
24
|
+
|
|
25
|
+
## Outcome
|
|
26
|
+
|
|
27
|
+
- Fixed behavior observed:
|
|
28
|
+
- Remaining weakness:
|
|
29
|
+
- Regression risk:
|
|
30
|
+
- What was not verified:
|
|
31
|
+
|
|
32
|
+
## Decision
|
|
33
|
+
|
|
34
|
+
- fixed / partially fixed / not fixed / unable to verify
|
|
35
|
+
- Follow-up required:
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Severity Rubric
|
|
2
|
+
|
|
3
|
+
Severity follows exploitability and blast radius, not code aesthetics.
|
|
4
|
+
|
|
5
|
+
## Reportability Gate
|
|
6
|
+
|
|
7
|
+
A security finding is reportable only if you can explain:
|
|
8
|
+
|
|
9
|
+
- attacker
|
|
10
|
+
- preconditions
|
|
11
|
+
- vulnerable path
|
|
12
|
+
- broken invariant or trust assumption
|
|
13
|
+
- concrete impact
|
|
14
|
+
|
|
15
|
+
If one of these is missing, keep it as a candidate or note, not a confirmed finding.
|
|
16
|
+
|
|
17
|
+
## Default Privilege Assumption
|
|
18
|
+
|
|
19
|
+
Assume owner, admin, governance, and other privileged roles act honestly unless the user explicitly asks for centralization or malicious-admin review.
|
|
20
|
+
|
|
21
|
+
- Honest-admin assumption violated:
|
|
22
|
+
- usually a trust-model note, not an exploitable vulnerability
|
|
23
|
+
- Unprivileged path or privilege gain caused by code:
|
|
24
|
+
- reportable security issue
|
|
25
|
+
|
|
26
|
+
## Severity Bands
|
|
27
|
+
|
|
28
|
+
### Critical
|
|
29
|
+
|
|
30
|
+
Realistic path to direct protocol-wide drain, permanent insolvency, irreversible control takeover, or widespread permanent fund lock with minimal preconditions.
|
|
31
|
+
|
|
32
|
+
### High
|
|
33
|
+
|
|
34
|
+
Serious fund loss, unfair liquidation, privilege escalation, or system-wide freeze under realistic but nontrivial conditions.
|
|
35
|
+
|
|
36
|
+
### Medium
|
|
37
|
+
|
|
38
|
+
Bounded financial loss, meaningful griefing or DoS, accounting drift, broken settlement, or localized control issues with narrower blast radius or stronger preconditions.
|
|
39
|
+
|
|
40
|
+
### Low
|
|
41
|
+
|
|
42
|
+
Edge-case user harm, limited operational failure, defense-in-depth gap with plausible but weak impact, or bugs that require several restrictive assumptions.
|
|
43
|
+
|
|
44
|
+
### Informational
|
|
45
|
+
|
|
46
|
+
Best-practice, maintainability, observability, or low-confidence concerns without direct exploitable impact.
|
|
47
|
+
|
|
48
|
+
## Confidence
|
|
49
|
+
|
|
50
|
+
- High:
|
|
51
|
+
- reproduced, traced end-to-end, or explicit code path with little ambiguity
|
|
52
|
+
- Medium:
|
|
53
|
+
- strong technical case, but no full repro or no deployment confirmation
|
|
54
|
+
- Low:
|
|
55
|
+
- suspicious pattern needing more evidence
|
|
56
|
+
|
|
57
|
+
Low confidence should rarely be presented as a core finding.
|
|
58
|
+
|
|
59
|
+
## Calibration Checks
|
|
60
|
+
|
|
61
|
+
- Downgrade if the exploit depends on unrealistic liquidity, unavailable permissions, or unsupported integrations.
|
|
62
|
+
- Downgrade if the blast radius is one actor or one edge path rather than a core protocol flow.
|
|
63
|
+
- Upgrade only when you can show concrete economic or control impact.
|
|
64
|
+
- Do not merge severity and confidence. A bug can be high severity and medium confidence.
|
|
65
|
+
|
|
66
|
+
## Special Cases
|
|
67
|
+
|
|
68
|
+
- Admin-only dangerous knobs:
|
|
69
|
+
- usually trust or centralization notes
|
|
70
|
+
- Missing slippage or deadline in user-facing swaps:
|
|
71
|
+
- reportable only if users are materially exposed
|
|
72
|
+
- Precision loss:
|
|
73
|
+
- severity depends on extractable value, not the mere presence of rounding
|
|
74
|
+
- Reentrancy, oracle, and callback issues:
|
|
75
|
+
- require an exploit path, not just a pattern match
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web3-fuzzing-and-invariants
|
|
3
|
+
description: Fuzzing and invariant orchestration layer for protocol reviews and smart contract testing. Use when deriving invariants, writing harnesses, evaluating property-based tests, or interpreting fuzz failures.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web3 Fuzzing And Invariants
|
|
7
|
+
|
|
8
|
+
Use this skill when the task is to derive invariants, set up fuzzing, or interpret failing cases in a security context.
|
|
9
|
+
|
|
10
|
+
## Required Components
|
|
11
|
+
|
|
12
|
+
- `web3-repo-heuristics`
|
|
13
|
+
- `web3-audit-reporting`
|
|
14
|
+
|
|
15
|
+
## Required Profile Adapters
|
|
16
|
+
|
|
17
|
+
- `property-based-testing`
|
|
18
|
+
- `harness-writing`
|
|
19
|
+
- `coverage-analysis`
|
|
20
|
+
- `state-invariant-detection`
|
|
21
|
+
|
|
22
|
+
Use [references/ADAPTER_CONSUMPTION_MAP.md](references/ADAPTER_CONSUMPTION_MAP.md)
|
|
23
|
+
to normalize fuzzing and invariant adapter output into stable evidence blocks.
|
|
24
|
+
Use [references/READINESS_AND_FAILURES.md](references/READINESS_AND_FAILURES.md)
|
|
25
|
+
and [references/OUTPUT_TEMPLATE.md](references/OUTPUT_TEMPLATE.md) to keep fuzz
|
|
26
|
+
campaign status and failure interpretation stable.
|
|
27
|
+
Use [scripts/render_fuzz_summary.py](scripts/render_fuzz_summary.py) when
|
|
28
|
+
downstream skills need a normalized fuzz/invariant summary.
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
1. Use `state-invariant-detection` to extract candidate invariants from protocol behavior.
|
|
33
|
+
2. Use `property-based-testing` to shape properties and failure expectations.
|
|
34
|
+
3. Use `harness-writing` to guide or review fuzz harness structure.
|
|
35
|
+
4. Use `coverage-analysis` to judge whether the fuzz campaign is meaningfully exploring the surface.
|
|
36
|
+
5. Convert only security-relevant, reproducible failures into findings via `web3-audit-reporting`.
|
|
37
|
+
|
|
38
|
+
## Invariant Classes
|
|
39
|
+
|
|
40
|
+
- accounting / conservation
|
|
41
|
+
- access control / authorization
|
|
42
|
+
- state transition ordering
|
|
43
|
+
- oracle / pricing assumptions
|
|
44
|
+
- upgrade / initialization safety
|
|
45
|
+
- integration safety for external tokens or protocols
|
|
46
|
+
|
|
47
|
+
## Reusable Output Contract
|
|
48
|
+
|
|
49
|
+
Always emit both:
|
|
50
|
+
|
|
51
|
+
1. A short fuzz/invariant progress summary
|
|
52
|
+
2. A normalized `fuzz_summary` block
|
|
53
|
+
|
|
54
|
+
The normalized block must preserve:
|
|
55
|
+
|
|
56
|
+
- campaign status
|
|
57
|
+
- invariant set
|
|
58
|
+
- harness status
|
|
59
|
+
- failing-case count
|
|
60
|
+
- exploit relevance
|
|
61
|
+
- residual coverage gaps and next steps
|
|
62
|
+
- exact evidence source per observed failure or gap
|
|
63
|
+
|
|
64
|
+
## Guardrails
|
|
65
|
+
|
|
66
|
+
- Do not confuse a weak harness with a secure protocol.
|
|
67
|
+
- A failing property is only a finding after root cause and exploit relevance are understood.
|
|
68
|
+
- If the repo lacks runnable fuzz infrastructure, say whether the blocker is tooling, build, or missing test hooks.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Fuzzing Adapter Consumption Map
|
|
2
|
+
|
|
3
|
+
- `state-invariant-detection` -> candidate invariants
|
|
4
|
+
- `property-based-testing` -> property definitions and failure expectations
|
|
5
|
+
- `harness-writing` -> harness quality and instrumentation
|
|
6
|
+
- `coverage-analysis` -> exploration quality and residual blind spots
|
|
7
|
+
|
|
8
|
+
Normalize into:
|
|
9
|
+
|
|
10
|
+
- invariant set
|
|
11
|
+
- harness status
|
|
12
|
+
- failing cases
|
|
13
|
+
- exploit relevance
|
|
14
|
+
- residual coverage gap
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Web3 Fuzzing Output Template
|
|
2
|
+
|
|
3
|
+
Always emit:
|
|
4
|
+
|
|
5
|
+
1. A short human-readable fuzzing summary
|
|
6
|
+
2. A normalized block
|
|
7
|
+
|
|
8
|
+
```yaml
|
|
9
|
+
fuzz_summary:
|
|
10
|
+
version: 1
|
|
11
|
+
campaign_status: partial
|
|
12
|
+
scope: test/invariants
|
|
13
|
+
harness_status: weak
|
|
14
|
+
invariant_set:
|
|
15
|
+
- totalAssets tracks deposits minus withdrawals
|
|
16
|
+
- only governance can change fee parameters
|
|
17
|
+
failing_case_count: 2
|
|
18
|
+
exploit_relevance: medium
|
|
19
|
+
coverage_gaps:
|
|
20
|
+
- liquidation branch not reachable in current harness
|
|
21
|
+
next_steps:
|
|
22
|
+
- improve state setup for liquidation path
|
|
23
|
+
evidence:
|
|
24
|
+
- adapter: state-invariant-detection
|
|
25
|
+
detail: accounting invariant extracted from vault flows
|
|
26
|
+
- adapter: coverage-analysis
|
|
27
|
+
detail: liquidation branch coverage remains zero
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Required Fields
|
|
31
|
+
|
|
32
|
+
- `campaign_status`: `ready | partial | blocked`
|
|
33
|
+
- `scope`
|
|
34
|
+
- `harness_status`
|
|
35
|
+
- `invariant_set`
|
|
36
|
+
- `failing_case_count`
|
|
37
|
+
- `exploit_relevance`
|
|
38
|
+
- `coverage_gaps`
|
|
39
|
+
- `next_steps`
|
|
40
|
+
- `evidence`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Fuzzing Readiness And Failure Semantics
|
|
2
|
+
|
|
3
|
+
Normalize fuzzing status into:
|
|
4
|
+
|
|
5
|
+
- `ready`
|
|
6
|
+
- harness exists, campaign is runnable, and observed failures are interpretable
|
|
7
|
+
- `partial`
|
|
8
|
+
- some harnessing or coverage exists, but exploration or instrumentation is incomplete
|
|
9
|
+
- `blocked`
|
|
10
|
+
- campaign cannot run or results are too weak to interpret
|
|
11
|
+
|
|
12
|
+
## Harness Status
|
|
13
|
+
|
|
14
|
+
- `strong`
|
|
15
|
+
- critical flows and state setup are covered
|
|
16
|
+
- `weak`
|
|
17
|
+
- campaign runs but misses meaningful state setup or assertions
|
|
18
|
+
- `missing`
|
|
19
|
+
- no viable harness exists
|
|
20
|
+
|
|
21
|
+
## Failure Interpretation
|
|
22
|
+
|
|
23
|
+
- A failing property is not a finding by itself.
|
|
24
|
+
- Root cause and exploit relevance determine whether a failure is audit-relevant.
|
|
25
|
+
- Coverage gaps belong in `coverage_gaps`, not in confirmed failures.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Render a stable Web3 fuzzing summary block."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import json
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
12
|
+
parser = argparse.ArgumentParser(description="Render a Web3 fuzzing summary block.")
|
|
13
|
+
parser.add_argument("--scope", required=True)
|
|
14
|
+
parser.add_argument(
|
|
15
|
+
"--campaign-status", choices=("ready", "partial", "blocked"), default="partial"
|
|
16
|
+
)
|
|
17
|
+
parser.add_argument(
|
|
18
|
+
"--harness-status", choices=("strong", "weak", "missing"), default="weak"
|
|
19
|
+
)
|
|
20
|
+
parser.add_argument("--invariant", action="append", default=[])
|
|
21
|
+
parser.add_argument("--failing-case-count", type=int, default=0)
|
|
22
|
+
parser.add_argument(
|
|
23
|
+
"--exploit-relevance", choices=("high", "medium", "low", "unknown"), default="unknown"
|
|
24
|
+
)
|
|
25
|
+
parser.add_argument("--coverage-gap", action="append", default=[])
|
|
26
|
+
parser.add_argument("--next-step", action="append", default=[])
|
|
27
|
+
parser.add_argument("--evidence", action="append", default=[])
|
|
28
|
+
return parser
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def parse_evidence(entries: list[str]) -> list[dict[str, str]]:
|
|
32
|
+
parsed = []
|
|
33
|
+
for entry in entries:
|
|
34
|
+
adapter, sep, detail = entry.partition(":")
|
|
35
|
+
if sep:
|
|
36
|
+
parsed.append({"adapter": adapter.strip(), "detail": detail.strip()})
|
|
37
|
+
else:
|
|
38
|
+
parsed.append({"adapter": "unknown", "detail": entry})
|
|
39
|
+
return parsed
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def main() -> int:
|
|
43
|
+
args = build_parser().parse_args()
|
|
44
|
+
payload = {
|
|
45
|
+
"fuzz_summary": {
|
|
46
|
+
"version": 1,
|
|
47
|
+
"campaign_status": args.campaign_status,
|
|
48
|
+
"scope": args.scope,
|
|
49
|
+
"harness_status": args.harness_status,
|
|
50
|
+
"invariant_set": args.invariant,
|
|
51
|
+
"failing_case_count": args.failing_case_count,
|
|
52
|
+
"exploit_relevance": args.exploit_relevance,
|
|
53
|
+
"coverage_gaps": args.coverage_gap,
|
|
54
|
+
"next_steps": args.next_step,
|
|
55
|
+
"evidence": parse_evidence(args.evidence),
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
json.dump(payload, sys.stdout, ensure_ascii=False, indent=2)
|
|
59
|
+
sys.stdout.write("\n")
|
|
60
|
+
return 0
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
raise SystemExit(main())
|