Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

ltyu - Refunds can be blocked by deposits #208

Closed
github-actions bot opened this issue Feb 21, 2023 · 0 comments
Closed

ltyu - Refunds can be blocked by deposits #208

github-actions bot opened this issue Feb 21, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@github-actions
Copy link

github-actions bot commented Feb 21, 2023

ltyu

high

Refunds can be blocked by deposits

Summary

Excess deposits can block deposit refunds

Vulnerability Detail

In DepositManagerV1.sol, a depositor can get a refund for their deposits by calling refundDeposit(). The availableFunds are then calculated by looping through the deposit list and validating the lockedFunds. This is problematic because anyone can create deposits. An attacker (or legitimate users) can deposit dust amounts and cause this array to get too big. The loop would then cause this validation to run out of gas.

Impact

Code Snippet

There is no validation for the size of deposit
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L21-L58

Tool used

At the last line of this snippet, the availableFunds are calculated. A loop is used in bounty.getLockedFunds(depToken)
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L152-L172

lockedFunds calculated here
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L333-L352

Manual Review

Recommendation

  • Consider a minimum deposit amount to reduce this attack vector

Duplicate of #77

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue labels Feb 21, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant