Skip to content

22.2 Vault security audit and property tests #1069

Description

@determined-001

Labels: type:security type:test area:contracts priority:critical
Milestone: Phase 4 - Workers W4: latency-sensitive and vault
Effort: High
Depends on: 22.1

Description

The vault holds user funds. Unit tests prove the cases someone thought of;
property tests and an external audit are how the cases nobody thought of get
found before a user does.

No W4 automation ships against an unaudited vault.

Acceptance criteria

  • Property tests assert the invariants: funds only ever return to their
    depositor; the allow-list only narrows; slippage bounds always hold; worker
    authority never widens
  • Fuzzing over deposit/withdraw/action sequences, including interleaved and
    reentrant orderings
  • External audit commissioned and the report published in the repo
  • Every audit finding is either fixed or has a written accepted-risk rationale
  • Audit report and its commit are linked from SECURITY.md
  • Deployment to mainnet is gated on audit completion, stated in the runbook

Implementation notes

  1. State the invariants as properties first, then fuzz against them - a fuzzer
    with no invariant is a slow random test.
  2. Publishing the report, including accepted risks, is worth more to the
    regulated-money audience than a clean-looking summary.
  3. Audit scheduling is maintainer work with lead time; start it while 22.3-22.5
    are in progress rather than after.

Affected files

  • contracts/vault/tests/property.rs
  • contracts/vault/tests/fuzz.rs
  • docs/audits/
  • SECURITY.md

Metadata

Metadata

Labels

Stellar WaveDrips Wave Program - opt an issue in by applying this labelarea:contractsSoroban contracts (contracts/)blockedWaiting on an upstream issuecomplexity:high200 pointspriority:criticalBlocks the release gate it belongs totype:security--forcetype:test--force

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions