Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Valid

Users Can Join DAOs Using Removed Currencies Due To Missing Validation

Lines of Code:
https://github.com/Cyfrin/2024-11-one-world/blob/1e872c7ab393c380010a507398d4b4caca1ae32b/contracts/dao/CurrencyManager.sol#L49-L57
https://github.com/Cyfrin/2024-11-one-world/blob/1e872c7ab393c380010a507398d4b4caca1ae32b/contracts/dao/MembershipFactory.sol#L140

Summary:

The lack of check in the joinDAO function can allow users to interact with a token that is not `whiteListed`. When the Admin_Role calls the removeCurrency function in the CurrencyManager.sol, it removes a currency from the whiteListed array and not generally from the system. Users can still join an existing DAO that was created with the currency that was recently removed.

Vulnerability Details:
The MembershipFactory contract allows users to join DAOs by paying with whitelisted currencies. However, there is no validation in the joinDAO function to verify if the DAO's currency is still whitelisted when users attempt to join. When a currency is removed from the CurrencyManager's whitelist, existing DAOs that use that currency remain active and continue accepting new members using the removed currency.

This occurs because:

  1. The DAO's configuration stores the currency address but doesn't track its whitelist status

  2. The joinDAO function only validates tier availability without checking currency status

  3. The CurrencyManager's removeCurrency function doesn't handle existing DAOs using the currency

Impact:

  • Users can bypass the currency whitelist system by joining DAOs that use removed currencies

  • Could lead to regulatory issues if currencies were removed for compliance reasons

  • Platform fees and DAO payments continue in removed currencies, potentially exposing users to deprecated or unsafe tokens

Recommended Mitigation:

Add currency whitelist validation in joinDAO:

function joinDAO(address daoMembershipAddress, uint256 tierIndex) external {
require(daos[daoMembershipAddress].noOfTiers > tierIndex, "Invalid tier.");
require(daos[daoMembershipAddress].tiers[tierIndex].amount > daos[daoMembershipAddress].tiers[tierIndex].minted, "Tier full.");
+ address currency = daos[daoMembershipAddress].currency;
+ require(currencyManager.isCurrencyWhitelisted(currency), "Currency not whitelisted");
uint256 tierPrice = daos[daoMembershipAddress].tiers[tierIndex].price;
uint256 platformFees = (20 * tierPrice) / 100;
daos[daoMembershipAddress].tiers[tierIndex].minted += 1;
IERC20(daos[daoMembershipAddress].currency).transferFrom(_msgSender(), owpWallet, platformFees);
IERC20(daos[daoMembershipAddress].currency).transferFrom(_msgSender(), daoMembershipAddress, tierPrice - platformFees); //my sends it to the Dao contract
IMembershipERC1155(daoMembershipAddress).mint(_msgSender(), tierIndex, 1);
emit UserJoinedDAO(_msgSender(), daoMembershipAddress, tierIndex);
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

skid0016 Submitter
11 months ago
skid0016 Submitter
11 months ago
0xbrivan2 Lead Judge
11 months ago
0xbrivan2 Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

missing DAO currency update

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.