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
Carousel.sol have 2 reentrancy callback that need to patch.
_emissionBalances update after internal _safeTransfercallback from ERC1155. There is no current exploit to manipulate emission balance, but it is still a potential risk.
_mintShares() also have callback from _mint(). Allow only one meaningful manipulation of mintRollovers(), with variable rolloverQueue assets and epochId. Both of these value only used for viewing after the function called.
So there is no risk of user losing fund or DOS yet, but it is still a potential risk.
This allow Carousel.sol have reentrancy exploit here and here. Both allow callback before changing emission balance.
callback inside safeTransferFrom() allow using old emissionBalances for withdraw. But balance calculation revert on underflow check anyway. So there is no way to exploit this.
Because enlistInRollover() and delistInRollover() does not have reentrancy protection. This allow exploiter to exploit rolloverQueue[] value.
Which mintRollovers() function happen to use _mintShares right before updating rolloverQueue.
Exploiter can update their own rolloverQueue value they want as long it is on top of the queue. Just call delist and then enlist with value they want. And it will be override later during mintRollovers() loop.
The rolloverQueue at this point does not use for anything except viewing. So no risk of fund loss.
Impact
Medium. No risk lost but can manipulate contract view function to show wrong value.
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
VAD37
medium
ERC1155
_doSafeTransferAcceptanceCheck()
reentrancy callback exploitsSummary
Carousel.sol
have 2 reentrancy callback that need to patch._emissionBalances
update after internal_safeTransfer
callback from ERC1155. There is no current exploit to manipulate emission balance, but it is still a potential risk._mintShares()
also have callback from_mint()
. Allow only one meaningful manipulation ofmintRollovers()
, with variablerolloverQueue
assets and epochId. Both of these value only used for viewing after the function called.So there is no risk of user losing fund or DOS yet, but it is still a potential risk.
Vulnerability Detail
Openzeppelin ERC1155 include callback for every safeTransfer call. This include
_mint()
as well.This allow
Carousel.sol
have reentrancy exploit here and here. Both allow callback before changing emission balance.callback inside
safeTransferFrom()
allow using oldemissionBalances
for withdraw. But balance calculation revert on underflow check anyway. So there is no way to exploit this.Because
enlistInRollover()
anddelistInRollover()
does not have reentrancy protection. This allow exploiter to exploitrolloverQueue[]
value.Which
mintRollovers()
function happen to use_mintShares
right before updatingrolloverQueue
.Exploiter can update their own
rolloverQueue
value they want as long it is on top of the queue. Just call delist and then enlist with value they want. And it will be override later duringmintRollovers()
loop.The
rolloverQueue
at this point does not use for anything except viewing. So no risk of fund loss.Impact
Medium. No risk lost but can manipulate contract view function to show wrong value.
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L201
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L536
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L437-L447
Tool used
Manual Review
Recommendation
enlistInRollover
anddelistInRollover
function.Duplicate of #468
The text was updated successfully, but these errors were encountered: