twicek security
refundDeposit
function can be DoS by an unbounded loop in getLockedFunds
deposits
array with a very large number of tiny deposits and DoS the DepositManagerV1.refundDeposit
function which will always revert.refundDeposit
function of the rely on the getLockedFunds
function to calculate the availableFunds
for a given token to refund: DepositManagerV1.sol#L171-L172BountyCore
, getLockedFunds
loops through all of the deposits ever made (this.getDeposits()
returns deposits
):deposits
array by calling fundBountyToken
multiples time since there is no limit to how much deposit can be made. He could even calculate approximatively how much deposit he has to make before the refundDeposit
function will DoS and get all his deposit back right before it is the case (assuming low expiration time). Therefore, he could fake being a legitimate participant of the protocol.refundDeposit
function can be DoS by a malicious user at a potentially very low cost (multiple transactions cost) depending on the chain.getLockedFunds
function is _depositId
while it should be called _depToken
since it's the deposit address.