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 authorization check for operators or owners in the MlumStaking::addToPosition() function always returns true, allowing any user to access this function for any token ID.
Vulnerability Detail
The MlumStaking::addToPosition() function is intended to be callable only by the owner or operators. It includes a check using _requireOnlyOperatorOrOwnerOf(), which uses msg.sender as both the owner and spender. This logic flaw results in the check always returning true, therefore allowing any user to call addToPosition() for any token ID.
function _requireOnlyOperatorOrOwnerOf(uint256tokenId) internalview {
// isApprovedOrOwner: caller has no rights on tokenrequire(ERC721Upgradeable._isAuthorized(msg.sender, msg.sender, tokenId), "FORBIDDEN");
}
Impact
MlumStaking::addToPosition() can be called by any user to lock another users token further
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
t.aksoy
Medium
Invalid authorized check for staking tokens
Summary
The authorization check for operators or owners in the
MlumStaking::addToPosition()
function always returns true, allowing any user to access this function for any token ID.Vulnerability Detail
The MlumStaking::addToPosition()
function is intended to be callable only by the owner or operators. It includes a check using_requireOnlyOperatorOrOwnerOf()
, which usesmsg.sender
as both the owner and spender. This logic flaw results in the check always returning true, therefore allowing any user to calladdToPosition()
for any token ID.Impact
MlumStaking::addToPosition()
can be called by any user to lock another users token furtherCode Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/42e799446595c542eff9519353d3becc50cdba63/magicsea-staking/src/MlumStaking.sol#L142
Tool used
Manual Review
Recommendation
Modify the check to use the actual token owner instead of msg.sender:
Duplicate of #378
The text was updated successfully, but these errors were encountered: