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
A malicious user can cause the callback function to always revert() which will halt the processing of deposits for other users as well.
Although mintDepositInQueue() has operations argument to continue deposits were left off, users depositing after the attacker are still vulnerable to the attack.
POC :
To run : forge test --match-test testDepositInQueue_POC -vv
As mintDepositInQueue loops through all the deposits, reverting will cause the processing of other user's deposits to fail, despite the underlying assets of these users already transferred to vault.
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
warRoom
high
ERC1155 callback can cause critical griefing attack
Summary
ERC-1155 mint functionality has a callback to the recipient's contract which can have malicious code.
Vulnerability Detail
Where : In mintDepositInQueue()
When : During ERC-1155 callback
Description :
mintDepositInQueue()
function users get minted ERC-1155 tokens._mint()
function of ERC-1155 has inherentonERC1155Received()
callback hook to recipient's contract.revert()
which will halt the processing of deposits for other users as well.mintDepositInQueue()
has operations argument to continue deposits were left off, users depositing after the attacker are still vulnerable to the attack.POC :
To run : forge test --match-test testDepositInQueue_POC -vv
The above script should pass :
Impact
mintDepositInQueue
loops through all the deposits, reverting will cause the processing of other user's deposits to fail, despite the underlying assets of these users already transferred to vault.Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L310-L355
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/3f610ebc25480bf6145e519c96e2f809996db8ed/contracts/token/ERC1155/ERC1155.sol#L447-L460
Tool used
Manual Review
Recommendation
Implement try and catch inside
mintDepositInQueue()
around_mintShares()
.Duplicate of #468
The text was updated successfully, but these errors were encountered: