Install
openclaw skills install audit-verification-pipeline审计finding三级验收流水线:自身forge test验证 → GitHub CI → 审查员评审。确保提交真实可靠的验证级产出。
openclaw skills install audit-verification-pipeline| 场景 | 对应能力 | 说明 |
|---|---|---|
| 写完 PoC 准备验证 | Level 1: Self-Verification | forge build + forge test 确认攻击效果 |
| 准备提交 finding 到外部平台 | Level 3: Pre-submission checklist | 提交前必须完成三级验收 |
| forge test 结果不确定 | Quality Self-Assessment | 判断 PASS 是否等于 finding 真实 |
| 判断 finding 严重度 | Severity Assessment Guide | 防止高估(Medium→Low 惯例) |
| 推送审计代码到 GitHub | Level 2: GitHub CI | CI 必须配置防止跳过验证 |
发现可疑代码 → 写 PoC → forge build → forge test
├─ PASS + 攻击效果确认 → 质量自评 → 提交宝总决策 → (是) 提交外部平台
├─ PASS + 无攻击效果 → 丢弃(FALSE POSITIVE)
└─ FAIL → 修复(最多3轮)→ 仍失败 → 丢弃
三级验收流水线,确保每个审计finding经过确定性验证后才作为交付物。
核心原则: 代码生成虽具概率性,但验证是确定性的。没有forge test PASS的finding不是交付物。
Level 1: Self-Verification (forge test PASS)
Level 2: GitHub CI (automated, prevents skipping)
Level 3: Auditor Review (novelty, severity, quality)
Serial dependency: L1 → L2 → L3. Skipping levels = no verification.
1. Read source code → identify suspicious pattern
2. Write finding description (draft)
3. Write Foundry PoC (.t.sol)
4. forge build → fix compilation errors (expect 2-3 rounds)
5. forge test → check result:
- PASS + attack effect confirmed → REAL
- PASS + attack effect = 0 → FALSE POSITIVE
- FAIL (PoC bug) → fix PoC, retry
- FAIL (code correct) → FALSE POSITIVE, discard
6. Quality self-assessment
7. Present to 宝总 for Level 3 decision
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.x;
import "forge-std/Test.sol";
import "../src/TargetContract.sol";
contract POC_FindingName is Test {
TargetContract target;
function setUp() public {
// Deploy contracts
// Setup state
}
function test_attack_succeeds() public {
// Step 1: Setup attack prerequisites
// Step 2: Execute attack
// Step 3: Assert attack effect (NOT just that tx succeeds)
assertGt(attackerProfit, 0, "Attack must produce profit");
}
}
vm.roll changes block number only, use vm.warp for timestampkiss())—, → etc. with ASCII【提交前质量自评】
- Finding ID: [F-XX]
- Verification: [ ] Compiled [ ] forge test PASS [ ] Attack effect verified
- Severity: [H/M/L/I] — Rationale: [why this severity]
- Novelty: [New / Known / Duplicate] — Source if known: [link]
- Known limitations: [any caveats]
# .github/workflows/audit-test.yml
name: Audit PoC Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: foundry-rs/foundry-toolchain@v1
- run: forge test --match-path "test/POC_*.t.sol" -vv
- run: forge build
Prevents Level 1 from being skipped due to session termination or memory loss. Every push must pass forge test before PR can be submitted.
| Severity | Criteria |
|---|---|
| HIGH | Direct fund loss, DoS of core function, permission escalation |
| MEDIUM | Indirect loss, constrained DoS, griefing with economic cost |
| LOW | Best practice violation, defense-in-depth, theoretical with no practical exploit |
| INFO | Code quality, documentation, no security impact |
Common overestimation: If impact requires multiple unlikely conditions, downgrade one level. Common underestimation: If impact is systemic (affects all users), upgrade one level.