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
Improper Access Control on _requireOnlyOperatorOrOwnerOf function
Summary
The permission function _requireOnlyOperatorOrOwnerOf on the MlumStaking contract returns always true failing to verify if the msg.sender is authorized for performing operations with the NFT.
Vulnerability Detail
The contract uses the function _isAuthorized incorrectly. The function should use as first parameter the owner, then the spender in order to verify. However the MlumStaking contract sends the msg.sender two times, making the function always return true.
Impact
Improper access control on NFT usage on the MlumStaking contract.
function _requireOnlyOperatorOrOwnerOf(uint256tokenId) internalview {
// isApprovedOrOwner: caller has no rights on tokenrequire(ERC721Upgradeable._isAuthorized(msg.sender, msg.sender, tokenId), "FORBIDDEN");
}
sherlock-admin4
changed the title
Sneaky Neon Mole - Improper Access Control on _requireOnlyOperatorOrOwnerOf function
slowfi - Improper Access Control on _requireOnlyOperatorOrOwnerOf function
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
slowfi
High
Improper Access Control on
_requireOnlyOperatorOrOwnerOf
functionSummary
The permission function
_requireOnlyOperatorOrOwnerOf
on theMlumStaking
contract returns always true failing to verify if the msg.sender is authorized for performing operations with the NFT.Vulnerability Detail
The contract uses the function
_isAuthorized
incorrectly. The function should use as first parameter theowner
, then thespender
in order to verify. However theMlumStaking
contract sends themsg.sender
two times, making the function always return true.Impact
Improper access control on NFT usage on the
MlumStaking
contract.Code Snippet
MlumStaking.sol#L140-L143
ERC721Upgradeable
contract_isAuthorized
functionTool used
Manual Review
Recommendation
Send the adequate parameters to the function to avoid malicious access controls.
Duplicate of #378
The text was updated successfully, but these errors were encountered: