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
Malicious user can DoS honest BribeRewarder by creating MAX_BRIBES_PER_POOL with very small amount
Summary
Malicious user can DoS honest BribeRewarder by creating MAX_BRIBES_PER_POOL with very small amount
Vulnerability Detail
Voter.sol allow any user to create/register bribeRewarder for any pool and max bribe that can be created per votingPeriod per pool is 5 ie MAX_BRIBES_PER_POOL
uint256internal constant MAX_BRIBES_PER_POOL =5;
function onRegister() externaloverride {
...
(addresspool, uint256[] memoryperiods) = rewarder.getBribePeriods();
for (uint256 i =0; i < periods.length; ++i) {
// TODO check if rewarder token + pool is already registeredrequire(periods[i] >= currentPeriodId, "wrong period");
@>require(_bribesPerPriod[periods[i]][pool].length+1<= Constants.MAX_BRIBES_PER_POOL, "too much bribes");
_bribesPerPriod[periods[i]][pool].push(rewarder);
}
}
A malicious user can take advantage of this MAX_BRIBES_PER_POOL to create multiple(5) bribeRewarder for multiple votingPeriod for a specific pool which he wants to DoS with very little amount(amountPerPeriod)
//How this works:
Suppose an honest user wanted to bribe for poolA to pass the minVotes or to attract voters
Malicious user saw this and created 5 bibeRewarder for the same poolA & bribe it from currentVotingPeriod to till he wants to DoS with amountPerPeriod = 1 wei
This will register the all 5 bribeRewarder to voter.sol contract( in _bribesPerPriod mapping)
When honest user will try to register the real bribeRewarder, it will revert due to MAX_BRIBES_PER_POOL( see above code )
Note: All this can be done with very little amount ie as little as 5 wei( 5 bibeRewarder * 1 wei )
sherlock-admin4
changed the title
Deep Rose Mandrill - Malicious user can DoS honest BribeRewarder by creating MAX_BRIBES_PER_POOL with very small amount
araj - Malicious user can DoS honest BribeRewarder by creating MAX_BRIBES_PER_POOL with very small amount
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
araj
Medium
Malicious user can
DoS
honest BribeRewarder bycreating
MAX_BRIBES_PER_POOL with verysmall
amountSummary
Malicious user can
DoS
honest BribeRewarder bycreating
MAX_BRIBES_PER_POOL with verysmall
amountVulnerability Detail
Voter.sol allow any user to create/register bribeRewarder for any pool and max bribe that can be created per votingPeriod per pool is 5 ie MAX_BRIBES_PER_POOL
A malicious user can take advantage of this MAX_BRIBES_PER_POOL to create multiple(5) bribeRewarder for multiple votingPeriod for a specific pool which he wants to DoS with very little amount(amountPerPeriod)
//How this works:
poolA
to pass the minVotes or to attract voterscreated
5 bibeRewarder for the same poolA & bribe it fromcurrentVotingPeriod
to till he wants to DoS withamountPerPeriod = 1 wei
register
the all 5 bribeRewarder to voter.sol contract( in _bribesPerPriod mapping)revert
due to MAX_BRIBES_PER_POOL( see above code )Note: All this can be done with very little amount ie as little as 5 wei( 5 bibeRewarder * 1 wei )
Impact
Honest pool can be DoSed with very little amount
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/libraries/Constants.sol#L17
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L130C4-L144C6
Tool used
Manual Review
Recommendation
There are couple of ways:
Duplicate of #190
The text was updated successfully, but these errors were encountered: