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 Oct 1, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 27, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
mintRollovers() keeps accounting of indexes it has processed from rolloverQueue in rolloverAccounting[_epochId]. And later when this function is called logic doesn't check the relationship between index and length and this is important as length of rolloverQueue can decrease due to a call from delistInRollover.
Vulnerability Detail
Due to delist feature length can be shortened and this will lead to index being higher than rolloverQueue.length and can cause underflow error. Due to an underflow error mintRollovers() will not work.
uint256 length = rolloverQueue.length;
uint256 index = rolloverAccounting[_epochId];
// revert if queue is empty or operations are more than queue lengthif (length ==0) revertOverflowQueue();
if (_operations > length || (index + _operations) > length)
_operations = length - index;
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
spyrosonic10
medium
Possible subtraction overflow in mintRollovers
Summary
mintRollovers()
keeps accounting of indexes it has processed fromrolloverQueue
in rolloverAccounting[_epochId]. And later when this function is called logic doesn't check the relationship betweenindex
andlength
and this is important as length ofrolloverQueue
can decrease due to a call fromdelistInRollover
.Vulnerability Detail
Due to delist feature length can be shortened and this will lead to
index
being higher thanrolloverQueue.length
and can cause underflow error. Due to an underflow errormintRollovers()
will not work.Impact
mintRollovers()
will not work as intended.Code Snippet
Carousel.sol#L371-L378
Tool used
Manual Review
Recommendation
Consider handling rolloverAccounting and delist properly
Duplicate of #72
The text was updated successfully, but these errors were encountered: