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
normal bribe rewarders may be blocked by malicious bribe rewarders
Summary
There is one max_bribes_per_pool limitation. Malicious users can create some bribe rewarders to register with voter. This will block normal bribe rewarders to register.
Vulnerability Detail
In Voter contract, voter allows bribe rewarder to register with one pool. This will encourage users to vote for this pool. The vulnerability is that there is one limitation bribe rewarders' count for each pool. Malicious users can create some bribe rewarders and register with voter. This will block some normal bribe rewarders to register with the pool.
What's more, when the malicious user register bribe rewarders with the pool, they can choose one quite small amount for reward , even malicious users can create one bribe rewarder with one zero-value token. So malicious users need spend almost nothing to block normal bribe rewarders. This will lead to the voters not vote for this pool.
functiononRegister()externaloverride{IBribeRewarderrewarder=IBribeRewarder(msg.sender);// Must be one bribe rewarder_checkRegisterCaller(rewarder);uint256currentPeriodId=_currentVotingPeriodId;(addresspool,uint256[]memoryperiods)=rewarder.getBribePeriods();for(uint256i=0;i<periods.length;++i){// TODO check if rewarder token + pool is already registeredrequire(periods[i]>=currentPeriodId,"wrong period");// @audit possible block actual bribe rewarder.require(_bribesPerPriod[periods[i]][pool].length+1<=Constants.MAX_BRIBES_PER_POOL,"too much bribes");_bribesPerPriod[periods[i]][pool].push(rewarder);}}
Poc
In this test, alice creates 5 bribe rewarders and register with voter contract. When bob wants to create 1 bribe rewarder and wants to register with voter contract, this will be reverted.
Normal users may not create one bribe rewarders and register with voter contract. This will impact the voters' voting result. Because this pool will have less or no extra rewards for the voters.
sherlock-admin4
changed the title
Future Mandarin Unicorn - normal bribe rewarders may be blocked by malicious bribe rewarders
jennifer37 - normal bribe rewarders may be blocked by malicious bribe rewarders
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
jennifer37
High
normal bribe rewarders may be blocked by malicious bribe rewarders
Summary
There is one max_bribes_per_pool limitation. Malicious users can create some bribe rewarders to register with voter. This will block normal bribe rewarders to register.
Vulnerability Detail
In Voter contract, voter allows bribe rewarder to register with one pool. This will encourage users to vote for this pool. The vulnerability is that there is one limitation bribe rewarders' count for each pool. Malicious users can create some bribe rewarders and register with voter. This will block some normal bribe rewarders to register with the pool.
What's more, when the malicious user register bribe rewarders with the pool, they can choose one quite small amount for reward , even malicious users can create one bribe rewarder with one zero-value token. So malicious users need spend almost nothing to block normal bribe rewarders. This will lead to the voters not vote for this pool.
Poc
In this test, alice creates 5 bribe rewarders and register with voter contract. When bob wants to create 1 bribe rewarder and wants to register with voter contract, this will be reverted.
Impact
Normal users may not create one bribe rewarders and register with voter contract. This will impact the voters' voting result. Because this pool will have less or no extra rewards for the voters.
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L130-L144
Tool used
Manual Review
Recommendation
Add one whiltelist for createBribeRewarder(). Only trusted operators can create one rewarder.
Duplicate of #190
The text was updated successfully, but these errors were encountered: