Users Can Reset Bond Depositor’s Vesting Period
The VaderBond.deposit() function overwrites a depositor's bond information, resetting the vesting period to the full term even if some vesting was already complete. An attacker could repeatedly deposit to reset the vesting period, forcing the bond holder to wait again to claim tokens they could previously claim.
Submitted by leastwood
Impact
The VaderBond.deposit() function overwrites a depositors bond info on each call with the updated payout information. If any of the vesting is left unclaimed before a call to deposit() is made, the vesting period is reset to terms.vestingTerm, resulting in the bond holder having to wait again in order to claim tokens that they could previously claim.
Proof of Concept
https://github.com/code-423n4/2021-11-vader/blob/main/repo/vader-bond/contracts/VaderBond.sol#L192
Tools Used
Manual code review.
Recommended Mitigation Steps
Consider preventing users from depositing to an existing bond holder or alternatively when a deposit is made, force the user to redeem any claimable tokens in the same function.
0xstormtrooper (Vader) acknowledged:
Users will be warned that depositing resets the vesting term. This will also be documented on the contract.
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
The deposit() function overwrites the existing bond information without preserving the remaining vesting period, resetting it to the full term.
Impact
A depositor could lose access to already-vested tokens until the full vesting term passes again, delaying or preventing them from claiming their tokens.
What the attacker needed
A bond deposit exists; attacker can call deposit()
The fix
The project acknowledged the issue and decided to warn users that depositing resets the vesting term, rather than changing the code.
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.
When you deposit into a bond, the contract records when you can claim your tokens. The bug is that if you deposit again before claiming everything, the contract resets the waiting period from scratch. This means someone could keep resetting the timer, so you have to wait longer to get tokens you already earned.
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.