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

Ruhum - Attacker can DOS bounty by funding it with worthless ERC20 tokens #75

Closed
github-actions bot opened this issue Feb 21, 2023 · 0 comments
Closed
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

Ruhum

medium

Attacker can DOS bounty by funding it with worthless ERC20 tokens

Summary

Bounties can only be funded with a set number of non-whitelisted ERC20 tokens. By adding worthless ERC20 tokens an attacker can stop the bounty issuer from adding their own deposit.

Vulnerability Detail

In DepositManagerV1.fundBountyToken() the contract limits the number of non-whitelisted ERC20 token deposits. By adding worthless ERC20 tokens an attacker can stop the bounty issuer from adding their own deposit. This will only work for bounties funded with non-whitelisted ERC20 tokens, e.g. the project's own token.

Impact

Bounty issuer won't be able to fund their bounty.

Code Snippet

DepositManagerV1.fundBountyToken()

    function fundBountyToken(
        address _bountyAddress,
        address _tokenAddress,
        uint256 _volume,
        uint256 _expiration,
        string memory funderUuid
    ) external payable onlyProxy {
        IBounty bounty = IBounty(payable(_bountyAddress));

        if (!isWhitelisted(_tokenAddress)) {
            require(
                !tokenAddressLimitReached(_bountyAddress),
                Errors.TOO_MANY_TOKEN_ADDRESSES
            );
        }
       // ...

Tool used

Manual Review

Recommendation

Using a bounty-specific whitelist would allow the issuer to specify the tokens they accept.

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