A majority attack can easily bypass Zora auction stage in OpenseaProposal and steal the NFT from the party.
A majority holder could bypass the Zora auction stage in a proposal to list an NFT on OpenSea by bidding on the auction with a contract that cannot receive ERC721 tokens, causing the auction to be cancelled and the proposal to proceed to OpenSea where the NFT could be bought at a low price. This allowed the attacker to steal the NFT from the party.
Submitted by Trust
The PartyGovernance system has many defenses in place to protect against a majority holder stealing the NFT. One of the main protections is that before listing the NFT on Opensea for a proposal-supplied price, it must first try to be auctioned off on Zora. To move from Zora stage to Opensea stage, \_settleZoraAuction() is called when executing ListedOnZora step in ListOnOpenseaProposal.sol. If the function returns false, the next step is executed which lists the item on Opensea. It is assumed that if majority attack proposal reaches this stage, it can steal the NFT for free, because it can list the item for negligible price and immediately purchase it from a contract that executes the Opensea proposal.
Indeed, attacker can always make settleZoraAuction() return false. Looking at the code:
try ZORA.endAuction(auctionId) {
// Check whether auction cancelled due to a failed transfer during
// settlement by seeing if we now possess the NFT.
if (token.safeOwnerOf(tokenId) == address(this)) {
emit ZoraAuctionFailed(auctionId);
return false;
}
} catch (bytes memory errData) {
As the comment already hints, an auction can be cancelled if the NFT transfer to the bidder fails. This is the relevant AuctionHouse code (endAuction):
{
// transfer the token to the winner and pay out the participants below
try IERC721(auctions[auctionId].tokenContract).safeTransferFrom(address(this), auctions[auctionId].bidder, auctions[auctionId].tokenId) {} catch {
_handleOutgoingBid(auctions[auctionId].bidder, auctions[auctionId].amount, auctions[auctionId].auctionCurrency);
_cancelAuction(auctionId);
return;
}
As most NFTs inherit from OpenZeppelin’s ERC721.sol code, safeTransferFrom will run:
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
So, attacker can bid a very high amount on the NFT to ensure it is the winning bid. When AuctionHouse tries to send the NFT to attacker, the safeTransferFrom will fail because attack will not implement an ERC721Receiver. This will force the AuctionHouse to return the bid amount to the bidder and cancel the auction. Importantly, it will lead to a graceful return from endAuction(), which will make settleZoraAuction() return false and progress to the OpenSea stage.
Impact
A majority attack can easily bypass Zora auction stage and steal the NFT from the party.
Proof of Concept
- Pass a ListOnOpenseaProposal with a tiny list price and execute it
- Create an attacker contract which bids on the NFT an overpriced amount, but does not implement ERC721Receiver. Call its bid() function
- Wait for the auction to end ( timeout after the bid() call)
- Create a contract with a function which calls execute() on the proposal and immediately buys the item on Seaport. Call the attack function.
Recommended Mitigation Steps
\_settleZoraAuction is called from both ListOnZoraProposal and ListOnOpenseaProposal. If the auction was cancelled due to a failed transfer, as is described in the comment, we would like to handle it differently for each proposal type. For ListOnZoraProposal, it should indeed return false, in order to finish executing the proposal and not to hang the engine. For ListOnOpenseaProposal, the desired behavior is to revert in the case of a failed transfer. This is because the next stage is risky and defense against the mentioned attack is required. Therefore, pass a revertOnFail flag to \_settleZoraAuction, which will be used like so:
// Check whether auction cancelled due to a failed transfer during
// settlement by seeing if we now possess the NFT.
if (token.safeOwnerOf(tokenId) == address(this)) {
if (revertOnFail) {
revert("Zora auction failed because of transfer to bidder")
}
emit ZoraAuctionFailed(auctionId);
return false;
}
merklejerk (PartyDAO) confirmed and commented:
Great find. We will modify
_settleZoraAuction()to return some auction status to be communicated up to the Opensea proposal.
HardlyDifficult (judge) commented:
TIL. While digging into this I noticed that Zora changed this logic in their V3 implementation, avoiding this scenario - but there may be reasons to prefer the auction house contract.
Agree with High risk - the auction safeguard can be bypassed, allowing a majority owner to steal from the rest of 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
The function _settleZoraAuction returns false when the NFT transfer to the bidder fails, which is interpreted as a signal to proceed to the OpenSea listing stage, without distinguishing between a genuine auction failure and a malicious bidder causing the failure.
What the attacker needed
Majority control of the party; ability to deploy contracts; proposal to list NFT on OpenSea
The fix
The fix was to modify _settleZoraAuction to return an auction status that is communicated to the OpenSea proposal, as confirmed by the team.
How it was found
- Pass a ListOnOpenseaProposal with a tiny list price and execute it
- Create an attacker contract which bids on the NFT an overpriced amount, but does not implement ERC721Receiver. Call its bid() function
- Wait for the auction to end (timeout after the bid() call)
- Create a contract with a function which calls execute() on the proposal and immediately buys the item on Seaport. Call the attack function.
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.
In a shared NFT investment group, a majority vote is needed to sell an NFT. The system first tries to auction it on Zora, and only if that fails does it list on OpenSea. An attacker with majority control can make the Zora auction fail by bidding with a contract that cannot receive NFTs, so the system moves to OpenSea where the attacker buys the NFT cheaply, stealing it from the group.
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.