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
Any user can create a bribe rewarder for any pool using RewardFactory.sol::createBribeRewarder, and in order to register the rewarder in Voter.sol, it requires that the rewarder has enough balance to cover the rewards, but the reward is set by the owner/creator of the rewarder. Furthermore, Voter.sol::onRegister has max amount of rewarders that a certain pool can have (5). Therefor a user can do the following:
Create 5 Bribe Rewarders with a target pool as beneficiary.
Use fundAndBribe with a minimum amount on each to register them.
Now the target pool can not register more rewarders and there is barely any incentive for voting for said pool.
For example, the following code tests registering a rewarder with an amount of 20 from an ERC20 with 18 decimals, meaning its the equivalent of having a 20 WEI reward, you may add it to BribeRewarder.t.sol for testing.
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
MrCrowNFT
Medium
[M-1] Bribe
Summary
Vulnerability Detail
Any user can create a bribe rewarder for any pool using
RewardFactory.sol::createBribeRewarder
, and in order to register the rewarder inVoter.sol
, it requires that the rewarder has enough balance to cover the rewards, but the reward is set by the owner/creator of the rewarder. Furthermore,Voter.sol::onRegister
has max amount of rewarders that a certain pool can have (5). Therefor a user can do the following:fundAndBribe
with a minimum amount on each to register them.For example, the following code tests registering a rewarder with an amount of 20 from an ERC20 with 18 decimals, meaning its the equivalent of having a 20 WEI reward, you may add it to
BribeRewarder.t.sol
for testing.Meaning that it would cost anyone <1USD to sabotage the reward system of any pool (not accounting for gas) making this scenario very likely.
Impact
This could potentially lead to unfair competition and sabotage during the voting periods.
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/42e799446595c542eff9519353d3becc50cdba63/magicsea-staking/src/rewarders/RewarderFactory.sol#L109-L113
https://github.com/sherlock-audit/2024-06-magicsea/blob/42e799446595c542eff9519353d3becc50cdba63/magicsea-staking/src/rewarders/BribeRewarder.sol#L226-L258
https://github.com/sherlock-audit/2024-06-magicsea/blob/42e799446595c542eff9519353d3becc50cdba63/magicsea-staking/src/Voter.sol#L130-L144
Tool used
Manual Review
Recommendation
Duplicate of #190
The text was updated successfully, but these errors were encountered: