Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Ch_301 - Users could be arbitrarily ejection from the rollover queue #263

Closed
sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

Ch_301

medium

Users could be arbitrarily ejection from the rollover queue

Summary

Vulnerability Detail

In case Bob has already queued up a rollover
Let's say: ownerToRollOverQueueIndex[address(Bob)] == X
and ownerToRollOverQueueIndex[address(Alice)] == rolloverQueue.length - 1
and rolloverAccounting[epoch Y] == X+5
epoch Y exists and has not started yet
rolloverQueue.length == Z and (X+5 < Z)

Bob will invoke delistInRollover() this logic will execute

else {
            rolloverQueue[index] = rolloverQueue[length - 1];
            rolloverQueue.pop();
            ownerToRollOverQueueIndex[rolloverQueue[index].receiver] = index +1;
            delete ownerToRollOverQueueIndex[_owner];
        }

So Alice queue will be ownerToRollOverQueueIndex[address(Alice)] == X
As we know rolloverAccounting[epoch Y] == X+5

Now Alice thinks she will be in epoch Y But unfortunately, this will never happen
in this way, she could be only in the next epoch Y+1

Impact

The logic of delistInRollover() could corrupt the rollover queue

Code Snippet

Tool used

Manual Review

Recommendation

You need to check rolloverAccounting[ ] for the next epoch with rolloverQueue[index]

Duplicate of #72

@github-actions github-actions bot closed this as completed Apr 3, 2023
@github-actions github-actions bot added High A valid High severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 11, 2023
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 valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant