Submitted by 0x52
User is able to withdraw unstaked asset sooner than they should be.
Unstake() allows the user to bypass the rebase() call by setting _trigger to false. Since rebase() is bypassed, epoch.number could potentially be stale i.e. doesnt match the Tokemak epoch. A user could potentially call unstake() with _trigger = false immediately after an epoch has ended but expiry would be set using the stale epoch.number because it wouldnt be updated by rebase(). This would allow the user to withdraw early before their funds were actually available in the contract because their withdrawal would be considered to be in the epoch before they actually initiated the withdrawal.
Rebase() cannot be optional when calling unstake.
toshiSat (Yieldy) acknowledged and commented:
