50922 sc low unstaking partially will extend the cooldown time for previously unstaked amount too
Description
Brief/Intro
Vulnerability Details
function _unstake(uint16 validatorId, uint256 amount) internal returns (uint256 amountToUnstake) {
PlumeStakingStorage.Layout storage $s = PlumeStakingStorage.layout();
********************SNIP******************
// Process cooldown logic and cleanup
uint256 newCooldownEndTimestamp = _processCooldownLogic(msg.sender, validatorId, amount); <@
_handlePostUnstakeCleanup(msg.sender, validatorId);
emit CooldownStarted(msg.sender, validatorId, amount, newCooldownEndTimestamp);
return amount;
}
function _processCooldownLogic(
address user,
uint16 validatorId,
uint256 amount
) internal returns (uint256 newCooldownEndTime) {
********************SNIP******************
newCooldownEndTime = block.timestamp + $.cooldownInterval;//@audit whenever the cooldown is updated the cooldown end time is updated.
********************SNIP******************
_updateCoolingAmounts(user, validatorId, amount);
finalNewCooledAmountForSlot = currentCooledAmountInSlot + amount;
}
********************SNIP******************
cooldownEntrySlot.cooldownEndTime = newCooldownEndTime; //@audit the cooldown time is updated
return newCooldownEndTime;
}Impact Details
References
Proof of Concept
Previous52041 sc low in arctoken attacker can reposition to last holder and capture entire yield remainderNext49639 sc insight gas inefficiency in loop storage reads processmaturedcooldowns
Was this helpful?