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.
Improper msg.sender check in the BribeRewarder._modify() function
Summary
When the _modify() function is called within the deposit() function, it will be reverted because of an incorrect check on msg.sender.
Vulnerability Detail
The deposit() function includes the onlyVoter modifier, indicating that msg.sender is the Voter contract. Consequently, when calling the _modify() function, it will encounter a revert at L264 due to the requirement for msg.sender to be the owner of tokenId, not the Voter contract. This renders voting impossible, as the Voter.vote() function triggers the deposit() function via the Voter._notifyBribes() function.
sherlock-admin4
changed the title
Smooth Taffy Moth - Improper msg.sender check in the BribeRewarder._modify() function
KupiaSec - Improper msg.sender check in the BribeRewarder._modify() function
Jul 29, 2024
KupiaSec
High
Improper
msg.sender
check in theBribeRewarder._modify()
functionSummary
When the
_modify()
function is called within thedeposit()
function, it will be reverted because of an incorrect check onmsg.sender
.Vulnerability Detail
The
deposit()
function includes theonlyVoter
modifier, indicating thatmsg.sender
is theVoter
contract. Consequently, when calling the_modify()
function, it will encounter a revert atL264
due to the requirement formsg.sender
to be the owner oftokenId
, not theVoter
contract. This renders voting impossible, as theVoter.vote()
function triggers thedeposit()
function via theVoter._notifyBribes()
function.Impact
Voting is impossible, resulting in the breakdown of the core functionality of the protocol.
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L143-L147
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L264-L266
Tool used
Manual Review
Recommendation
The
msg.sender
check should not be applied when the_modify()
function is called within thedeposit()
function.Duplicate of #39
The text was updated successfully, but these errors were encountered: