Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

PUSH0 - MLUM's voting power can be double-spent if the position's expiry coincides with a period #69

Closed
sherlock-admin2 opened this issue Jul 15, 2024 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A High severity issue. Reward A payout will be made for this issue

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Jul 15, 2024

PUSH0

High

MLUM's voting power can be double-spent if the position's expiry coincides with a period

Summary

Per the code comments, the condition for a position to be able to vote is that the initial lock duration is at least 3 months, and the position is locked.

// check if _minimumLockTime >= initialLockDuration and it is locked

Per the docs:

The overall lock needs to be longer then 90 days and the remaining lock period needs to be longer then the epoch time.

However, should a position's expiry coincides with a voting period (which is literally any possible time because voting periods are consecutive and continuous), then a user is able to vote twice in one period for the same amount of MLUM by withdrawing then locking a new position.

Vulnerability Detail

Consider the following scenario:

  • Alice locks MLUM for 3 months, so she is eligible to vote.
  • Alice's lock position expires in 1 week, but the voting epoch has just begun and will end in 2 weeks.
  • Alice votes for her pool now.
  • After one week, Alice withdraws her lock position and gets back her MLUM. However she then locks the exact same position again, and vote again in the same period.

If the period has a bribe, then it also has an additional effect of Alice being able to get more bribes for the same MLUM amount.

Impact

Voting power of each MLUM can be double-spent, causing inflated rewards for a pool, and unfair bribe distributions if any.

Code Snippet

https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L170-L178

Tool used

Manual Review

Recommendation

The condition for voting eligibility should be the lock position expires after the voting epoch ends, not just at the time of voting.

Duplicate of #166

@github-actions github-actions bot added duplicate High A High severity issue. labels Jul 21, 2024
@sherlock-admin2 sherlock-admin2 added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jul 22, 2024
@sherlock-admin4 sherlock-admin4 changed the title Icy Basil Seal - MLUM's voting power can be double-spent if the position's expiry coincides with a period PUSH0 - MLUM's voting power can be double-spent if the position's expiry coincides with a period Jul 29, 2024
@sherlock-admin4 sherlock-admin4 added the Reward A payout will be made for this issue label Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A High severity issue. Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

2 participants