ArbitraryCallsProposal.sol and ListOnOpenseaProposal.sol safeguards can be bypassed by cancelling in-progress proposal allowing the majority to steal NFT
The safeguards in ArbitraryCallsProposal and ListOnOpenseaProposal can be bypassed by cancelling a proposal mid-execution, leaving NFT approvals in place. A majority could then use an arbitrary call proposal to list the NFT for sale at a very low price and buy it, stealing it from the party.
Submitted by 0x52
Note: PartyDAO acknowledges that “canceling an InProgress proposal (mid-step) can leave the governance party in a vulnerable or undesirable state because there is no cleanup logic run during a cancel” in the “Known Issues / Topics” section of the contest readme. I still believe that this vulnerability needs to be mitigated as it can directly lead to loss of user funds.
Impact
Majority vote can abuse cancel functionality to steal an NFT owned by the party.
Proof of Concept
ArbitraryCallsProposal.sol implements the following safeguards for arbitrary proposals that are not unanimous:
- Prevents the ownership of any NFT changing during the call. It does this by checking the the ownership of all NFTs before and after the call.
- Prevents calls that would change the approval status of any NFT. This is done by disallowing the “approve” and “setApprovalForAll” function selectors.
Additionally ListOnOpenseaProposal.sol implements the following safeguards:
- NFTs are first listed for auction on Zora so that if they are listed for a very low price then the auction will keep them from being purchased at such a low price.
- At the end of the auction the approval is revoked when
\_cleanUpListingis called.
These safeguards are ultimately ineffective though. The majority could use the following steps to steal the NFT:
- Create ListOnOpenseaProposal with high sell price and short cancel delay
- Vote to approve proposal with majority vote
- Execute first step of proposal, listing NFT on Zora auction for high price
- Wait for Zora auction to end since the auction price is so high that no one will buy it
- Execute next step, listing the NFT on Opensea. During this step the contract grants approval of the NFT to the Opensea contract
- Wait for cancelDelay to expire
- Call PartyGovernance.sol#cancel. This will immediately terminate the Opensea bypassing
\_cleanUpListingand keeping the approval to the Opensea contract. - Create ArbitraryCallsProposal.sol that lists the NFT on Opensea for virtually nothing. Since only approval selectors have been blacklisted and the NFT does not change ownership, the proposal does not need to be unanimous to execute.
- Approve proposal and execute.
- Buy NFT.
Recommended Mitigation Steps
When a proposal is canceled, it should call a proposal specific function that makes sure everything is cleaned up. NFTs delisted, approvals revoked, etc.
merklejerk (PartyDAO) confirmed and commented:
We will block calls to
opensea.validate()in Arbitrary call proposals.
HardlyDifficult (judge) commented:
Agree with High risk - in this scenario a majority owner could steal the asset from others in the party.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the cancel function terminates a proposal without running its cleanup logic, so approvals granted during the proposal remain active.
What the attacker needed
Majority control of the party; ability to create and pass proposals; wait for auction and cancel delay
The fix
The project blocked calls to opensea.validate() in arbitrary call proposals, and a pull request was merged to resolve the issue.
How it was found
- Create a ListOnOpenseaProposal with a high sell price and a short cancel delay.
- Vote to approve the proposal with a majority vote.
- Execute the first step, listing the NFT on a Zora auction at a high price.
- Wait for the Zora auction to end without any buyer.
- Execute the next step, listing the NFT on OpenSea and granting approval to the OpenSea contract.
- Wait for the cancel delay to expire, then call cancel to terminate the proposal without cleanup.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A group of people jointly own an NFT through a smart contract. The contract has rules to stop a majority from selling the NFT cheaply to themselves. This report shows that by cancelling a proposal halfway through, those rules can be skipped, letting the majority buy the NFT for almost nothing.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.