Project

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

Reorg Vulnerability in DAO Membership Creation Allows Users to Join Incorrect DAOs

Summary

Due to the reliance on MembershipFactory address and nonce during DAO creation, reorgs on the Polygon chain could direct users to join incorrect DAOs, resulting in potential fund loss and unexpected costs.

Vulnerability Details

The project is set to deploy on the Polygon chain, which can be subject to reorg attacks.

The createNewDAOMembership function creates a new DAO membership by deploying a proxy as shown below:

TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
membershipImplementation,
address(proxyAdmin),
abi.encodeWithSignature("initialize(string,string,string,address,address)", daoConfig.ensname, "OWP", baseURI, _msgSender(), daoConfig.currency)
);

The proxy address relies solely on the MembershipFactory address and its nonce, making it vulnerable in a reorg scenario. If a reorg alters the sequence of transactions, the previously assigned daoMembershipAddress could end up pointing to a different DAO.

Consider this scenario:

  1. daoA is created and assigned address1.

  2. User bob decides to join daoA by approving tokens for address1 and calling joinDAO.

  3. If a reorg occurs, daoB’s transaction may precede daoA’s, resulting in daoA inadvertently receiving address2 and daoB receiving address1. (daoB could be malicious, or it's just a coincidence)

  4. Consequently, when Bob’s transaction is confirmed, he joins daoB instead of daoA, which is not what he wants, causing loss of funds, especially when daoB's price is higher than daoA's.

Impact

This vulnerability allows for funds to be directed to unintended DAO contracts in case of a reorg, creating the potential for loss of funds or unexpected transaction costs for users who inadvertently join the wrong DAO.

Tools Used

Manual

Recommendations

To mitigate reorg-related risks, incorporate ensName and daoCreator verification within the joinDAO function. This will help ensure the correct DAO is joined even if reorgs occur. Also this could strength the function's robustness in case of user error.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge
10 months ago
0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

reorg issues

Appeal created

bluedragon Auditor
10 months ago
0xbrivan2 Lead Judge
10 months ago
0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

reorg issues

Support

FAQs

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