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

ast3ros - [M-02] receivingFunds is subjected to DDOS attacks #432

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

ast3ros - [M-02] receivingFunds is subjected to DDOS attacks #432

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 Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@github-actions
Copy link

github-actions bot commented Feb 21, 2023

ast3ros

medium

[M-02] receivingFunds is subjected to DDOS attacks

Summary

When receiving funds, the receivingFunds function allow maximum of not-yet-whitelist tokens to be deposited into the bounty.
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L45-L50

A malicious account could deposit any ERC20 tokens they want into bounty with the amount of 1 wei. If they deposit number of tokens equal TOKEN_ADDRESS_LIMIT, the bounty will not accept any valid tokens from the issuer.

Vulnerability Details

The receivingFunds function accept any ERC20 tokens and record it to tokenAddresses set.
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L45-L50
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L55

The length of the tokenAddresses set can be manipulated by any external account.

Impact

  • Issuers could not fund the bounty with their valid tokens because the number of tokens is TOKEN_ADDRESS_LIMIT.
  • The gas cost for operations that needs to loop through tokenAddresses set is higher.

Code Snippet

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L45-L50
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L55

Tool used

Manual

Recommendation

Allow issuers to whitelist token address for their own bounty. The bounty only receives funds using whitelist tokens

Duplicate of #530

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium 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 Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant