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.
reverts in Voter.vote() due to wrong check in BribeRewarder._modify() [DOS]
Summary
Vulnerability Detail
Ownership of tokenID won't be transferred to Voter.sol during vote() so the below check in BribeRewarder._modify() is wrong because voter.sol is going to be msg.sender and voter.sol isn't tokenID owner.
function _modify(uint256periodId, uint256tokenId, int256deltaAmount, boolisPayOutReward)
privatereturns (uint256rewardAmount)
{
if (!IVoter(_caller).ownerOf(tokenId, msg.sender)) {
revertBribeRewarder__NotOwner();
}
_modify() is used by BribeRewarder.deposit() which is called in _notifyBribes()
Voter.vote() will always revert BribeRewarder__NotOwner() because of the wrong check.
Impact
reverts in Voter.vote() due to wrong check in BribeRewarder._modify()
sherlock-admin4
changed the title
Mean Sandstone Sardine - reverts in Voter.vote() due to wrong check in BribeRewarder._modify() [DOS]
AuditorPraise - reverts in Voter.vote() due to wrong check in BribeRewarder._modify() [DOS]
Jul 29, 2024
AuditorPraise
High
reverts in
Voter.vote()
due to wrong check inBribeRewarder._modify()
[DOS]Summary
Vulnerability Detail
Ownership of tokenID won't be transferred to Voter.sol during
vote()
so the below check inBribeRewarder._modify()
is wrong because voter.sol is going to be msg.sender and voter.sol isn't tokenID owner._modify()
is used byBribeRewarder.deposit()
which is called in_notifyBribes()
Voter.vote()
will always revertBribeRewarder__NotOwner()
because of the wrong check.Impact
reverts in
Voter.vote()
due to wrong check inBribeRewarder._modify()
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L264
Tool used
Manual Review
Recommendation
pass the msg.sender that calls
Voter.vote()
as a param intoBribeRewarder.deposit()
and then intoBribeRewarder._modify()
and use it for the checkDuplicate of #39
The text was updated successfully, but these errors were encountered: