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.
Wrong input validation while checking for locked position in Voter.sol
Summary
Wrong input validation while checking for locked position in Voter.sol
Vulnerability Detail
For a user to vote using Voter::vote(), _minimumLockTime should be greater than initialLockDuration and position should be locked.
While checking for locked position, it checks position.lockDuration and this can be issue because lockDuration can be greater than _periodDuration but position is not locked
After 3 Months, user position will be unlocked, but user can still vote and bypass the above check because lockDuration is still 3 months, which is greater than _periodDuration ie 14 days
sherlock-admin4
changed the title
Deep Rose Mandrill - Wrong input validation while checking for locked position in Voter.sol
araj - Wrong input validation while checking for locked position in Voter.sol
Jul 29, 2024
araj
High
Wrong input validation while checking for locked position in Voter.sol
Summary
Wrong input validation while checking for locked position in Voter.sol
Vulnerability Detail
For a user to vote using Voter::vote(), _minimumLockTime should be greater than initialLockDuration and position should be locked.
While checking for locked position, it checks position.lockDuration and this can be issue because lockDuration can be greater than _periodDuration but position is not locked
// How this works
Impact
Users with unlocked position can also vote
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L175C7-L177C10
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/MlumStaking.sol#L374C7-L383C12
Tool used
Manual Review
Recommendation
Check the position's remaining locked time(MlumStaking::_remainingLockTime()) instead of lockDuration & compare it with _periodDuration
Duplicate of #166
The text was updated successfully, but these errors were encountered: