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 May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Feb 22, 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
If attackers call DepositManager.fundBountyToken() enough times, the deposits array will be large enough to make getLockedFunds revert with an out-of-gas error
Impact
Funders cannot get refunds.
The attack is cheap (low gas on Polygon + minimum deposit is 1 wei), making it extremely likely to happen.
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
joestakey
medium
refundDeposit
can be DOSSummary
Attackers can fill up the
deposits
array to DOS refundsVulnerability Detail
DepositManager.refundDeposit()
computes the funds available by callingbounty.getLockedFunds
This function loops through the
deposits
array:deposits
grows on every deposit:If attackers call
DepositManager.fundBountyToken()
enough times, thedeposits
array will be large enough to makegetLockedFunds
revert with an out-of-gas errorImpact
Funders cannot get refunds.
The attack is cheap (low gas on Polygon + minimum deposit is 1 wei), making it extremely likely to happen.
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L341-L349
Tool used
Manual Review
Recommendation
You can either add an upper limit to
deposits
, or add a minimum deposit amount to make the attack too expensive.Duplicate of #77
The text was updated successfully, but these errors were encountered: