This repository has been archived by the owner on May 26, 2023. It is now read-only.
Jeiwan - Non-whitelisted tokens cannot be added if the limit of token addresses is filled with whitelisted ones #530
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Jeiwan
medium
Non-whitelisted tokens cannot be added if the limit of token addresses is filled with whitelisted ones
Summary
Non-whitelisted tokens cannot be deposited to a bounty contract if too many whitelisted contracts were deposited.
Vulnerability Detail
The DepositManagerV1.fundBountyToken function allows depositing both whitelisted and non-whitelisted tokens by implementing the following check:
openQTokenWhitelist.TOKEN_ADDRESS_LIMIT
tokens have already been deposited.However, while the token addresses limit requirement is only applied to non-whitelisted tokens, whitelisted tokens also increase the counter of token addresses: both non-whitelisted and whitelisted token addresses are added to the
tokenAddresses
set.Impact
Bounty minters may not be able to deposit non-whitelisted tokens after they have deposited multiple whitelisted ones.
Code Snippet
DepositManagerV1.sol#L45-L50
BountyCore.sol#L326-L328
BountyCore.sol#L55
Tool used
Manual Review
Recommendation
Consider excluding whitelisted token addresses when checking the number of deposited tokens against the limit.
The text was updated successfully, but these errors were encountered: