Open hats-bug-reporter[bot] opened 1 year ago
Hello, Thanks a lot for your attention. For a given vestingSchedule the totalAmount will not change (unless if it's revoked). Also the total released (for a vestingSchedule) and the amountReleased (for a tokenId) are always calculated in regards of the totalAmount. And finally we increment theses variables at the end of the function. If totalAmount is reached, the transaction will revert with the following "NOT_RELEASABLE" require (because the amount calculated will be 0). Same for the revoke (that will only be used in case of extreme emergency), the underflow is not possible because the totalReleased will always be lower or equal to totalAmount. In conclusion we have so to consider this issue as invalid.
Github username: @iamjakethehuman Submission hash (on-chain): 0x6b9017b050deeb8b397463e112b2ee2eab9c1d4298cf90b2050055e82b2461ac Severity: high
Description: Description\ Seeds can release more tokens than anticipated.
Attack Scenario\ Via
VestingCvg
vestingschedules can be created (e.g. for aseed
). By doing so an amount to be released is specified.However, due to a flaw in logic seeds can bypass this restrictions and release infinite tokens. Upon calling
realeseSeed
a call to_computeReleaseAmount
is made. It calculates the neededamountToRelease
.However, there isn't a check to make sure the new
vestingSchedules[vestingScheduleId].totalReleased
isnt >vestingSchedules[vestingScheduleId].totalAmount
. This would allow for seed owners to release tokens endlessly and bypass restrictions. Furthermore, oncevestingSchedules[vestingScheduleId].totalReleased > vestingSchedules[vestingScheduleId].totalAmount
, the vesting schedule cannot even be revoked as a call torevokeVestingSchedule
will revert due to underflowThis way seed owners can bypass all restrictions, release more tokens than anticipated and break accounting and core functionalities, hence the High severity.
Note: this issue is also true for WL and Ibo owners.
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional) Add a restriction that the released
vestingSchedules[vestingScheduleId].totalReleased <= vestingSchedules[vestingScheduleId].totalAmount