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` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Queued deposits can get stuck indefinitely in the deposit queue
Summary
Queued deposits can get stuck indefinitely in the deposit queue. By taking advantage of this, an attacker can purposefully grief early users by freezing their funds in the contract.
Vulnerability Detail
The first users to deposit into the deposit queue will be the last to have their deposit minted because the loop in mintDepositInQueue implements a First In Last Out stack for deposits.
An attacker can spam the deposit queue with small deposits (with _assets >= relayerFee). Doing so, he can grief early depositors by queuing just enough deposits so that it becomes impossible to mint all queued deposit in one call to mintDepositInQueue due to out of gas revert. If someone calls mintDepositInQueue and mint X deposits, the attacker can back-run the transaction with the same exact number of deposits to make sure early depositors will never get their deposit minted.
Since there is no mechanism allowing users to remove queued deposits, early depositors will risk to have their deposited funds frozen in the contract as long as the attacker decides.
Impact
An attacker can grief early users by freezing their funds in the contract.
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` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
twicek
medium
Queued deposits can get stuck indefinitely in the deposit queue
Summary
Queued deposits can get stuck indefinitely in the deposit queue. By taking advantage of this, an attacker can purposefully grief early users by freezing their funds in the contract.
Vulnerability Detail
The first users to deposit into the deposit queue will be the last to have their deposit minted because the loop in
mintDepositInQueue
implements a First In Last Out stack for deposits.An attacker can spam the deposit queue with small deposits (with
_assets >= relayerFee
). Doing so, he can grief early depositors by queuing just enough deposits so that it becomes impossible to mint all queued deposit in one call tomintDepositInQueue
due to out of gas revert. If someone callsmintDepositInQueue
and mint X deposits, the attacker can back-run the transaction with the same exact number of deposits to make sure early depositors will never get their deposit minted.Since there is no mechanism allowing users to remove queued deposits, early depositors will risk to have their deposited funds frozen in the contract as long as the attacker decides.
Impact
An attacker can grief early users by freezing their funds in the contract.
Code Snippet
_deposit
mintDepositInQueue
Tool used
Manual Review
Recommendation
Consider implementing a First In First Out stack for the queued deposits.
Duplicate of #174
The text was updated successfully, but these errors were encountered: