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.
Voting Malfunction Leading to Core Protocol Vulnerability
Summary
Function Voter:vote is responsible to vote for a particular pool, only stakers of Mlum in MlumStaking.sol can call this function, While there is a check which is stopping to execute whole vote function and impacting the core functionality of the protocol.
Remove the check in _modify for the owner of the tokenId as it has been already verified in the voter.sol, and add a check in function claim to verify it the msg.sender is the owner of tokenId.
sherlock-admin4
changed the title
Acidic Cloth Pigeon - Voting Malfunction Leading to Core Protocol Vulnerability
nikhil840096 - Voting Malfunction Leading to Core Protocol Vulnerability
Jul 29, 2024
nikhil840096
High
Voting Malfunction Leading to Core Protocol Vulnerability
Summary
Function
Voter:vote
is responsible to vote for a particular pool, only stakers ofMlum
inMlumStaking.sol
can call this function, While there is a check which is stopping to execute whole vote function and impacting the core functionality of the protocol.Vulnerability Detail
When the staker Of
Mlum
will callvote
function with the parametershttps://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L153-L156
All check will passed and execution will proceed to
_notifyBribes
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L211
If we look at the execution of this function
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L221-L229
For each rewarder it will call the deposit function of that rewarder contract, and the rewarder here is
BribeRewarder
If we look at
BribeRewarder:deposit
functionhttps://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L143-L147
It has a modifier
onlyVoter
which checks if the called is thevoter
contract or not, so this will pass as the msg.sender is the voter contract.Then it calls
_modify
function ,if we look at that functionhttps://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L260-L267
In starting of the execution of the function there is a check, which checks if the owner of the tokenId(The staking position's tokenId )
is
msg.sender
or not, if not then it reverts and will halt full execution of vote function. So asmsg.sender
is theVoter
so this will get failed.Impact
The voting will not work breaking the core functionality of the function.
High
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L260-L267
Tool used
Manual Review
Recommendation
Remove the check in _modify for the owner of the tokenId as it has been already verified in the
voter.sol
, and add a check in functionclaim
to verify it themsg.sender
is the owner of tokenId.Duplicate of #39
The text was updated successfully, but these errors were encountered: