Open hats-bug-reporter[bot] opened 1 year ago
Hello, Thanks a lot for your attention. We don't consider misconfiguration as an issue.We are aware of this and assume the risks. The revoke is here just in case of extreme emergency. In conclusion we have so to consider this issue as invalid.
Github username: @iamjakethehuman Submission hash (on-chain): 0x04d07ad49dc3e5c5e62fdd392c07e511774e60436e1608767a4e84fac8c867ac Severity: high
Description: Description\ Whenever a vesting schedule is created for a type with an active vesting schedule, there'll be unexpected behaviour.
Attack Scenario\ In
VestingCvg
the owner can create vesting schedules with different types. Upon creating one, thevestingIdForType
mapping is updated as follows.The problem is that it allows for value overwriting. Upon the 2nd call with the same
_vestingType
the old value will be overwritten and the following will happen. For easier readability, until the end of the report we will refer to the old (overwritten)tokenId
astokenId : 1
and the 2nd astokenId : 2
: Upon callingreleaseSeed
/releaseWl
/releaseIbo
with the old (first)_tokenId = 1
:_computeReleaseAmount
will be called and will calculateamountToRelease
based on theseedInfo
of the old_tokenId = 1
. If thetotalAmount
of it is bigger than thetotalAmount
of it is > than thetotalAmount
of_tokenId = 2
, it will allow forvestingSchedules[vestingScheduleId].totalReleased
to be bigger than thevestingSchedules[_vestingScheduleId].totalAmount
and will break all accounting.amountReleasedIdSeed[1]
>amountToRelease
releaseSeed
will revert due to an underflow incalculateRelease
_tokenId = 1
) it will allow for faster release of all tokens in the first vesting schedule.Attachments
Proof of Concept (PoC) File
Revised Code File (Optional) Implement logic to not allow for creating of new vesting schedules for the same vesting type if there are such currently active.