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
The DepositManagerV1.sol::fundBountyToken() must accept only whitelisted tokens.
Summary
The DepositManagerV1.sol::fundBountyToken() function accepts non whitelisted tokens if the bounty has not reached the token address limit which is dangerous because the bounty could be feeded with malicious ERC20 tokens.
Vulnerability Detail
The DepositManagerV1.sol::fundBountyToken() accepts non whitelisted tokens if the Bounty has not reached the token address limit as you can see:
Deposits with malicious tokens can be dangerous so the protocol should accept only whitelisted tokens.
I created a test in DepositManager.test.js where it is possible to deposit a non whitelisted token.
Create the atomic bounty.
Approve the blackListed token.
Set the token address limit in order to accept several tokens.
Fund the bounty and the blackListed token will be accepted.
File: DepositManager.test.js
282: it('should revert if funded with a non-whitelisted token.', async () => {
283: // The bounty must accept only whitelisted tokens.284: // 1. Create the atomic bounty.285: // 2. Approve the blackListed token.286: // 3. Set the token address limit in order to accept several tokens.287: // 4. Fund the bounty and the blackListed token will be accepted.288: //289: // 1. Create the atomic bounty.290: //291: await openQProxy.mintBounty(Constants.bountyId, Constants.organization, atomicBountyInitOperation);
292: const bountyAddress = await openQProxy.bountyIdToAddress(Constants.bountyId);
293: //294: // 2. Approve the blackListed token.295: //296: await blacklistedMockDai.approve(bountyAddress, 10000000);
297: //298: // 3. Set the token address limit in order to accept several tokens.299: //300: await openQTokenWhitelist.setTokenAddressLimit(10);
301: //302: // 4. Fund the bounty and the blackListed token will be accepted.303: // 304: await expect(depositManager.fundBountyToken(
305: bountyAddress,
306: blacklistedMockDai.address,
307: 10000000,
308: 1,
309: Constants.funderUuid)).to.not.be.revertedWith('TOO_MANY_TOKEN_ADDRESSES');
310: });
Code Snippet
The fundBountyToken() accepts the non whitelisted token if the bounty has not reached the limit.
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
0xbepresent
medium
The
DepositManagerV1.sol::fundBountyToken()
must accept only whitelisted tokens.Summary
The DepositManagerV1.sol::fundBountyToken() function accepts non whitelisted tokens if the bounty has not reached the token address limit which is dangerous because the bounty could be feeded with malicious ERC20 tokens.
Vulnerability Detail
The
DepositManagerV1.sol::fundBountyToken()
accepts non whitelisted tokens if the Bounty has not reached the token address limit as you can see:That behaivor could be potentially dangerous if there are deposits with a malicious tokens like:
The DepositManagerV1.sol::fundBountyNFT() checks if the NFT address is whitelisted beforehand, so the
fundBountyToken()
should have the same logic.Impact
Deposits with malicious tokens can be dangerous so the protocol should accept only whitelisted tokens.
I created a test in DepositManager.test.js where it is possible to deposit a non whitelisted token.
Code Snippet
The
fundBountyToken()
accepts the non whitelisted token if the bounty has not reached the limit.The
fundBountyNFT()
checks if the token address is whitelisted.Tool used
Vscode
Recommendation
Follow the same logic used in the
fundBountyNFT()
, checks if the token is whitelisted regardless of the token address limit.Duplicate of #62
The text was updated successfully, but these errors were encountered: