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 21, 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
Array state variables deposits is growing indefinitely, this might lead to expensive transactions and effectively denial of service for the user when calling refundDeposit() function, because this one is calling getLockedFunds() that requires iterations over the whole deposits array.
Vulnerability Detail
Attacker can call DepositManagerV1.fundBountyToken() with :
_tokenAddress as 0x0 address
set _volume to any value > 0
send nothing (msg.value = 0)
This scenario will create a valid deposit with volume[depositId] = 0
Attackers can repeat this scenario indefinitely until deposits array length will be big enough to make reverting getLockedFunds (and by the way refundDeposit function) due to gas limit.
Impact
User will not be able to get refunded because refundDeposit function is not working proprely.
Consider adding a whitelist of users that can add deposit, or in general simply permit to add a whitelist of users that can interact with DepositManagerV1.sol 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` labelHighA valid High severity issueRewardA payout will be made for this issue
MyFDsYours
high
Possible DOS can lock user's funds
Summary
Array state variables deposits is growing indefinitely, this might lead to expensive transactions and effectively denial of service for the user when calling refundDeposit() function, because this one is calling getLockedFunds() that requires iterations over the whole deposits array.
Vulnerability Detail
Attacker can call DepositManagerV1.fundBountyToken() with :
This scenario will create a valid deposit with volume[depositId] = 0
Attackers can repeat this scenario indefinitely until deposits array length will be big enough to make reverting getLockedFunds (and by the way refundDeposit function) due to gas limit.
Impact
User will not be able to get refunded because refundDeposit function is not working proprely.
Code Snippet
receiveFunds (called by fundBountyToken) in BountyCore.sol#L40-L58
getLockedFunds in BountyCore.sol#L333-L352
Tool used
Manual Review
Recommendation
Duplicate of #77
The text was updated successfully, but these errors were encountered: