Skip to content

fix(contracts): remove vulnerable reclaim_after_settlement and add so… - #1758

Merged
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
Fridayddev:fix/remove-reclaim-after-settlement
Oct 24, 2026
Merged

1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
Fridayddev:fix/remove-reclaim-after-settlement

Conversation

@Fridayddev

Copy link
Copy Markdown
Contributor

Closes #1705

Summary of Changes
Vulnerability Fix (Approach A):
Removed reclaim_after_settlement from the contract. Under Soroban balance-delta accounting, there is no legitimate per-vault residual to sweep, and removing the endpoint completely eliminates the theft vector where draft or settled vaults could drain the contract's entire token balance.
Preserved Error::StakedRemaining = 22 in contracts/accountability_vault/src/lib.rs to ensure error discriminant numerical stability.
Spec Regeneration:
Removed the reclaim_after_settlement definition from contracts/accountability_vault/spec/AccountabilityVault.spec.json.
Tests Added:
test_reclaim_cannot_drain_other_vaults: Regression test asserting that an attacker creating a Draft vault cannot drain the contract balance or victim funds, and that invoking reclaim_after_settlement fails.
test_balance_covers_outstanding_stakes: Solvency invariant property test running randomized operations (create_vault, stake, check_in, claim_milestone, claim, slash_on_miss, withdraw) across vaults with a seeded PRNG, asserting after each step that contract_balance >= sum(staked).
Branch Isolation:
Work on the separate issue branch fix/dispute-milestone-guards-and-reset was preserved and left completely isolated.

@1nonlypiece
1nonlypiece merged commit fcd6869 into Disciplr-Org:main Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[contracts] Stop reclaim_after_settlement from draining other vaults' funds

2 participants