Polygon's block reorg problem may lead to use join a wrong DAO created by an attacker.
A DAO is created by deploying a proxy using the new
keyword.
MembershipFactory.sol#L72-L76:
To join a DAO, a user needs to specify the address of the DAO membership along with the index of the tier to join, and protocol validates the tier index and tier amount of this specified DAO address.
MembershipFactory.sol#L140-L150:
It works fine under normal circumstances, however, things might go wrong if there is a reorg. In fact, high-depth block reorgs are happening DAILY in Polygon, and a third of these had double-digit block reorg depth, as can be viewd on Polygonscan’s Forked Blocks page.
It's possible that DAO creations and joinings are included fully within a reorg, an attacker is able to frontrun the creator's DAO creation, effectively stealing the DAO instance at that particular address(MembershipFactory
uses new
to create DAO proxies, and the address is depent on the contract's nonce), leading to the user pays funds to join a malicious DAO.
Consider the following scenario:
A popular DAO membership is created with limited amount in each tier, assuming the DAO proxy address is proxyA
;
The users backrun to mint membership NFTs therefore they join the DAO at the same block of the DAO creation;
Reorg happens at the DAO creation block;
An Attacker frontruns the the origin DAO creation transaction to deploy his own DAO, so attacker's DAO address is proxyA
;
The origin DAO creation transaction is executed, but the DAO is deployed on a different address other than proxyA
;
The users' joining DAO transactions are exeucted, but they are minted with the tokens of the malicious DAO.
High-depth block reorgs are not rare on Polygon, therefore the probability of this issue may be low but not negligible, and the impact is high as users waste funds to join a wrong DAO.
Manual Review
Deployments of DAO proxy instances should be done employing create2
with a salt
calculated based on msg.sender
and nonce
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.