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

Ch_301 - mintRollovers() will skip The user's queue arbitrarily #266

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

mintRollovers() will skip The user's queue arbitrarily

Summary

Vulnerability Detail

In case Bob has already queued up a rollover
Let's say:
All the queues are already minted by relayers for epoch Y. The epoch Y exists and has not started yet

ownerToRollOverQueueIndex[address(Bob)] == rolloverQueue.length - 1
and rolloverAccounting[epoch Y] == rolloverQueue.length - 1

Bob will invoke delistInRollover() this logic will execute

        if (index == length - 1) {
            // if only one item in queue
            rolloverQueue.pop();
            delete ownerToRollOverQueueIndex[_owner];
        }

Now Alice will call enlistInRollover() this logic will execute

else {
            // if not, add to queue
            rolloverQueue.push(
                QueueItem({
                    assets: _assets,
                    receiver: _receiver,
                    epochId: _epochId
                })
            );
        }

After that Eve will also invoke enlistInRollover() this logic will execute

else {
            // if not, add to queue
            rolloverQueue.push(
                QueueItem({
                    assets: _assets,
                    receiver: _receiver,
                    epochId: _epochId
                })
            );
        }

relayer now will call mintRollovers(). only the queue of Eve will execute.
Alice needs to wait until the next epoch Y+1

Impact

mintRollovers() will skip Alice's queue arbitrarily

Code Snippet

Tool used

Manual Review

Recommendation

The protocol should handle this scenario correctly (The queue of both Alice and Eve should be executed)

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