Submitted by bin2chen, also found by bin2chen, immeas, KIntern_NA, ronnyx2017, and deadrxsezzz
The Vesting._vested() method is used to calculate the maximum claimable amount for the current user. The calculation formula is as follows: (_totalAmount * (block.timestamp - _start)) / _duration. If there is an __initialUnlockTimeOffset, it needs to be subtracted from _start before performing the calculation, i.e., _start = _start - __initialUnlockTimeOffset.
The issue with the code snippet above is that the check for being Fully vested is incorrect; it does not take into account the __initialUnlockTimeOffset. The correct approach should be:
if (block.timestamp >= _start - __initialUnlockTimeOffset + _duration) return _totalAmount;// Fully vested. Resulting in calculations that may be greater than the maximum number _totalAmount
Example:
_totalAmount = 500 , duration = 1000 __initialUnlockTimeOffset = 100 start = 1000 block.timestamp= 1999 because block.timestamp < start + duration  (1999 < 1000 + 1000) it will not return Fully vested.
Final calculation result:
start = start - __initialUnlockTimeOffset = 1000 - 100 = 900.
return = (_totalAmount * (block.timestamp - _start)) / _duration = 500 * (1999 - 900) / 1000 = 549.5.
It is greater 49.5 than the maximum _totalAmount=500.
Users can `claim more than they should.
cryptotechmaker (Tapioca) confirmed, but disagreed with severity and commented via duplicate Issue #167
