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
The _requireOnlyOperatorOrOwnerOf function in the MlumStaking contract has a vulnerability, and users can bypass the judgment
Summary
The _requireOnlyOperatorOrOwnerOf function in the MlumStaking contract has a vulnerability, and anyone can bypass this function
Vulnerability Detail
The code for the _requireOnlyOperatorOrOwnerOf function is as follows:
function _requireOnlyOperatorOrOwnerOf(uint256tokenId) internalview {
// isApprovedOrOwner: caller has no rights on tokenrequire(ERC721Upgradeable._isAuthorized(msg.sender, msg.sender, tokenId), "FORBIDDEN");
}
Continue to track the ERC721Upgradeable._isAuthorized function:
Because in the function _requireOnlyOperatorOrOwnerOf, the first two parameters passed to the _isAuthorized function are both msg.sender, so owner equals spender inside the _isAuthorized function, so the _isAuthorized function always returns true!
Impact
The function _requireOnlyOperatorOrOwnerOf is invalid
function _requireOnlyOperatorOrOwnerOf(uint256tokenId) internalview {
// isApprovedOrOwner: caller has no rights on tokenrequire(ERC721Upgradeable._isAuthorized(_ownerOf(tokenId), msg.sender, tokenId), "FORBIDDEN");
}
sherlock-admin4
changed the title
Agreeable Rose Peacock - The _requireOnlyOperatorOrOwnerOf function in the MlumStaking contract has a vulnerability, and users can bypass the judgment
neon2835 - The _requireOnlyOperatorOrOwnerOf function in the MlumStaking contract has a vulnerability, and users can bypass the judgment
Jul 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
neon2835
Medium
The _requireOnlyOperatorOrOwnerOf function in the MlumStaking contract has a vulnerability, and users can bypass the judgment
Summary
The _requireOnlyOperatorOrOwnerOf function in the MlumStaking contract has a vulnerability, and anyone can bypass this function
Vulnerability Detail
The code for the _requireOnlyOperatorOrOwnerOf function is as follows:
Continue to track the ERC721Upgradeable._isAuthorized function:
Because in the function _requireOnlyOperatorOrOwnerOf, the first two parameters passed to the _isAuthorized function are both msg.sender, so
owner
equalsspender
inside the _isAuthorized function, so the _isAuthorized function always returns true!Impact
The function _requireOnlyOperatorOrOwnerOf is invalid
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/MlumStaking.sol#L140-L142
Tool used
Manual Review
Recommendation
Modify and optimize
Duplicate of #378
The text was updated successfully, but these errors were encountered: