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
As the bribe rewarder pool creation is permissionless, and there is a cap to the number of bribe rewarders that can be created per pool (MAX_BRIBES_PER_POOL = 5), a malicious party can create rewarder pools with dummy tokens and large periods to DoS valid bribe rewarder pool creations.
Vulnerability Detail
Anyone can create a BribeRewarder through the RewardFactory with any ERC20 token. Upon funding the bribe pool, it calls Voter.onRegister(), which caps the number of rewarders that can be added. Hence, it would be possible for anyone to create many dummy pools that are seeded with minimal liquidity for long voting periods to block valid bribe rewarder creations.
sherlock-admin4
changed the title
Lone Opaque Mustang - Bribe rewarder pool creation can be DoSed
Reentrants - Bribe rewarder pool creation can be DoSed
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
Reentrants
Medium
Bribe rewarder pool creation can be DoSed
Summary
As the bribe rewarder pool creation is permissionless, and there is a cap to the number of bribe rewarders that can be created per pool (
MAX_BRIBES_PER_POOL = 5
), a malicious party can create rewarder pools with dummy tokens and large periods to DoS valid bribe rewarder pool creations.Vulnerability Detail
Anyone can create a
BribeRewarder
through theRewardFactory
with any ERC20 token. Upon funding the bribe pool, it callsVoter.onRegister()
, which caps the number of rewarders that can be added. Hence, it would be possible for anyone to create many dummy pools that are seeded with minimal liquidity for long voting periods to block valid bribe rewarder creations.POC
The setup can be found in the gist.
https://gist.github.com/Reentrants/50898e49155a13b9eddbe69ea52c1a19#file-e2etest-t-sol-L193-L204
For brevity, the case is linked below.
Impact
Users desiring to create a valid bribe rewarder pool cannot do so.
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/7fd1a65b76d50f1bf2555c699ef06cde2b646674/magicsea-staking/src/Voter.sol#L141
https://github.com/sherlock-audit/2024-06-magicsea/blob/7fd1a65b76d50f1bf2555c699ef06cde2b646674/magicsea-staking/src/rewarders/BribeRewarder.sol#L255
Tool used
Manual Review
Recommendation
Consider whitelisting the type of tokens that can be used as bribes, and enforcing a minimum amount per voting period for each token.
Duplicate of #190
The text was updated successfully, but these errors were encountered: