You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA Medium severity issue.RewardA payout will be made for this issue
DoS if approved address tries to harvest multiple positions with MlumStaking::harvestPositionsTo
Summary
DoS if approved address tries to harvest multiple positions with MlumStaking::harvestPositionsTo, due to bad validation
Vulnerability Detail
When approved to tokenIds user(not owner), calls MlumStaking::harvestPositionsTo, he is going to face "FORBIDDEN" revert, due to require((msg.sender == tokenOwner && msg.sender == to),"FORBIDDEN");, that always requires msg.sender == tokenOwner, which is not intended as we can see from the comment Can only be called by lsNFT's owner or approved address
/** * @dev Harvest from multiple staking positions to "to" address * * Can only be called by lsNFT's owner or approved address */function harvestPositionsTo(uint256[] calldatatokenIds, addressto) externaloverride nonReentrant {
_updatePool();
uint256 length = tokenIds.length;
for (uint256 i =0; i < length; ++i) {
uint256 tokenId = tokenIds[i];
_requireOnlyApprovedOrOwnerOf(tokenId);
address tokenOwner =ERC721Upgradeable.ownerOf(tokenId);
// if sender is the current owner, must also be the harvest dst address// if sender is approved, current owner must be a contractrequire(
(msg.sender== tokenOwner &&msg.sender== to), // legacy || tokenOwner.isContract()"FORBIDDEN"
);
_harvestPosition(tokenId, to);
_updateBoostMultiplierInfoAndRewardDebt(_stakingPositions[tokenId]);
}
}
Impact
DoS when approved address tries to harvest multiple positions
sherlock-admin4
changed the title
Stable Grape Panda - DoS if approved address tries to harvest multiple positions with MlumStaking::harvestPositionsTo
radin200 - DoS if approved address tries to harvest multiple positions with MlumStaking::harvestPositionsToJul 29, 2024
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA Medium severity issue.RewardA payout will be made for this issue
radin200
High
DoS if approved address tries to harvest multiple positions with
MlumStaking::harvestPositionsTo
Summary
DoS if approved address tries to harvest multiple positions with
MlumStaking::harvestPositionsTo
, due to bad validationVulnerability Detail
When approved to tokenIds user(not owner), calls
MlumStaking::harvestPositionsTo
, he is going to face "FORBIDDEN" revert, due torequire((msg.sender == tokenOwner && msg.sender == to),"FORBIDDEN");
, that always requires msg.sender == tokenOwner, which is not intended as we can see from the commentCan only be called by lsNFT's owner or approved address
Impact
DoS when approved address tries to harvest multiple positions
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/42e799446595c542eff9519353d3becc50cdba63/magicsea-staking/src/MlumStaking.sol#L465-L489
Tool used
Manual Review
Recommendation
Duplicate of #329
The text was updated successfully, but these errors were encountered: