Open code423n4 opened 2 years ago
Thank you warden on the findings and we did think about adding a grace withdrawing period to further strengthen the users' trust to the admin. I would argue that severity is medium in the case as in practical sense we would assume admin will inform the receivers upon revocation and therefore withdrawAdmin was designed to be separated from revokeClaim.
I acknowledge that some malicious admin might abuse this right and to claimed the receiver's already earned token before they claimed (as described in the scenario in this findings) and therefore we will consider adding the grace period to restrict admin to act maliciously.
I am going to stick with H, even a non malicious admin would have no choice but to kindly ask a user to claim before they revoked all their other tokens. If the user didn't comply the admin has no option but to either "steal" their tokens or allow them to keep vesting.
I am not sure about how this can be attributed to an issue. to me, the terms and conditions are clearly stated and user is aware of the consequences. This is how the real world scenario is happening. like when you apply for the insurance, the rules and regulations are very clear. May be, user can be known prior to the revoking. This is the missing piece.
The other case could be, lets say, there is an malicious user who can gain by using any other mean, in this situation, the admin is supposed to restrict that user to steal fund from the pool. How this can be prevent if there are not revoke claim mechanism.
If you look at this with high issue, then preventing the malicious user can be another high issue. that can not be handled if this revoke claim is not considered.
Lines of code
https://github.com/code-423n4/2022-09-vtvl/blob/f68b7f3e61dad0d873b5b5a1e8126b839afeab5f/contracts/VTVLVesting.sol#L418 https://github.com/code-423n4/2022-09-vtvl/blob/f68b7f3e61dad0d873b5b5a1e8126b839afeab5f/contracts/VTVLVesting.sol#L147-L151 https://github.com/code-423n4/2022-09-vtvl/blob/f68b7f3e61dad0d873b5b5a1e8126b839afeab5f/contracts/VTVLVesting.sol#L364
Vulnerability details
Impact
Vesting is a legal term that means the point in time where property is earned or gained by some person. The VTVLVesting contract defines:
The administrator of the contract can revoke the claim for a user at any time, which for vesting assets is expected. For example an employee with a vesting stock allocation of 1000 shares vesting at each quarter over a period of 4 years, may resign after 2 years and therefore the only half of the shares would be vested and therefore sold by the employee. The employee can either sell them at each quarter, or before, or after resigning, in any case the half of the shares have vested and are by legal right owned by the employee.
The VTVLContract revoke has the following defects:
Raising as high impact because it actually causes:
Proof of Concept
The following two tests prove the behaviour difference when the order by which revokeClaim vs withdraw are called, whch shows that the vesting right is not guaranteed.