52113 sc low stakingfacet unstake uint16 validatorid uint256 amount can be abused to bypass minstakeamount
Description
Vulnerability details
2
Key code excerpt (from _unstake)
366 function _unstake(uint16 validatorId, uint256 amount) internal returns (uint256 amountToUnstake) {
367 PlumeStakingStorage.Layout storage $s = PlumeStakingStorage.layout();
368
369 // Validate unstaking conditions
370 _validateValidatorForUnstaking(validatorId);
371 if (amount == 0) {
372 revert InvalidAmount(amount);
373 }
374 if ($s.userValidatorStakes[msg.sender][validatorId].staked < amount) {
375 revert InsufficientFunds($s.userValidatorStakes[msg.sender][validatorId].staked, amount);
376 }
377
378 // Update rewards before balance changes
379 PlumeRewardLogic.updateRewardsForValidator($s, msg.sender, validatorId);
380
381 // Update stake amounts
382 _updateUnstakeAmounts(msg.sender, validatorId, amount);
383
384 // Process cooldown logic and cleanup
385 uint256 newCooldownEndTimestamp = _processCooldownLogic(msg.sender, validatorId, amount);
386 _handlePostUnstakeCleanup(msg.sender, validatorId);
387
388 emit CooldownStarted(msg.sender, validatorId, amount, newCooldownEndTimestamp);
389 return amount;
390 }Impact
1
2
Proof of Concept
Suggested mitigation (note: not prescriptive code)
References
Previous49710 sc high cross batch state manipulation in yield distribution allows double dipping of yield fundsNext50973 sc insight incorrect parameter type in setjackpotprobabilities
Was this helpful?