This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
jennifer37 - Non-functional vote() if there is one bribe rewarder for this pool #39
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A High severity issue.
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Comments
github-actions
bot
added
High
A High severity issue.
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
labels
Jul 21, 2024
This was referenced Jul 21, 2024
Closed
Closed
Closed
Closed
This was referenced Jul 21, 2024
Closed
Closed
sherlock-admin3
added
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
labels
Jul 22, 2024
The internal |
This was referenced Jul 27, 2024
The protocol team fixed this issue in the following PRs/commits: |
sherlock-admin4
changed the title
Future Mandarin Unicorn - Non-functional vote() if there is one bribe rewarder for this pool
jennifer37 - Non-functional vote() if there is one bribe rewarder for this pool
Jul 29, 2024
The Lead Senior Watson signed off on the fix. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A High severity issue.
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
jennifer37
High
Non-functional vote() if there is one bribe rewarder for this pool
Summary
Permission check in BribeRewarder::deposit(), this will lead to vote() function cannot work if voted pool has any bribe rewarder.
Vulnerability Detail
When people vote for one pool, there may be some extra rewards provided by bribe rewarders. When users vote for one pool with some bribe rewarders, voter contract will call bribe rewarder's
deposit
function. However, in bribe rewarder'sdeposit()
function, there is one security check, the caller should be the NFT's owner, which is wrong. Because the voter contract call bribe rewarder'sdeposit()
, msg.sender is voter contract, not the owner of NFT.This will block all vote() transactions if this votes pool has any bribe rewarder.
Poc
When alice tries to vote for one pool with one bribe rewarder, the transaction will be reverted with the reason 'BribeRewarder__NotOwner'
Impact
vote() will be blocked for pools which owns any bribe rewarders.
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L143-L147
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L260-L269
Tool used
Manual Review
Recommendation
This security check should be valid in claim() function. We should remove this check from deposit().
The text was updated successfully, but these errors were encountered: