Double spending attack in the Vesting contract
The vesting reset function sets a user's claimed amount back to zero without accounting for a withdrawal that happened just before the reset. A user could therefore claim the same tokens twice, draining funds meant for other users.
0x73696d616f Follow with ge6a
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-03-symm-io-stacking-judging/issues/650
The protocol has acknowledged this issue.
Found by
0x73696d616f, ge6a
Summary
The function resetVestingPlans() is called by an administrator account and resets vesting plans for a list of users, with the corresponding amount provided as input. The function calls _resetVestingPlans(), where it checks whether the given amount is greater than or equal to the claimed amount for the user. After that, it calls resetAmount() from LibVestingPlan. In this function, the state is updated, the new amount is recorded, and claimedAmount is set to 0.
Root Cause
The issue here is that this can lead to double spending. Even though the user executing the request is trusted, they cannot know whether another transaction has been executed before theirs, in which the user whose vesting plan is being reset has withdrawn their locked amount by paying a penalty fee. If this happens, the user will be able to claim the same amount again after the reset, which would harm other users who might not be able to claim their rewards.
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
- Trusted user sends a transaction for executes resetVestingPlans()
- Regular user subject of this reset sends a transaction that is executed before the first one and claim their locked tokens as they pay a penalty
- After the reset the user is able to claim the tokens up to amount again
Impact
Loss of funds for the protocol and for the users
PoC
No response
Mitigation
No response
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the reset logic zeroes the claimed amount without checking whether the user withdrew funds in a transaction ordered just before the reset.
Impact
The protocol and other users could lose funds because the same tokens may be claimed twice.
What the attacker needed
An administrator resets a vesting plan; the user withdraws before the reset lands
How it was found
- An administrator submits a transaction calling resetVestingPlans for a user.
- The user withdraws their locked tokens by paying a penalty, and this transaction executes first.
- After the reset runs, the user can claim tokens up to the reset amount again.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vesting plan locks tokens for a user and tracks how much they have already taken out. The reset function wipes that 'already taken' counter, so if the user withdrew just before the reset, they can withdraw the same tokens a second time.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.