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

qmdddd - The function vote does not check if the position is locked for the current vote period. #146

Closed
sherlock-admin4 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-admin4
Copy link

sherlock-admin4 commented Jul 15, 2024

qmdddd

Medium

The function vote does not check if the position is locked for the current vote period.

Summary

The function vote does not check if the position is locked for the current vote period. As a result, users can withdraw their position back as soon as they vote.

Vulnerability Detail

In the function vote, the protocol checks the initialLockDuration and lockDuration to ensure the position has a long lock time. However, it does not check if the position is locked for the current period. Therefore, users can withdraw their position back as soon as they vote. As a result, an attacker can increase the weight of a pool without being locked.

Impact

An attacker can increase the weight of a pool without being locked.

Code Snippet

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

Tool used

Manual Review

Recommendation

Check the position is locked in the current vote period.

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 Straight Fuzzy Mouse - The function vote does not check if the position is locked for the current vote period. qmdddd - The function vote does not check if the position is locked for the current vote 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