adminAccountMigration() Does Not Update buyPrice.seller
The adminAccountMigration function updates the seller address for auctions but not for buy prices, so if an NFT has both an auction and a buy price, migrating the account leaves the buy price seller unchanged. This creates a deadlock where neither the old nor new address can cancel the auction or withdraw the NFT without the other's cooperation.
Submitted by leastwood, also found by cccz
NFTMarketReserveAuction.sol#L263-L292 NFTMarketBuyPrice.sol#L125-L141
The adminAccountMigration() function is called by the operator role to update all sellers’ auctions. The auction.seller account is updated to the new address, however, the protocol fails to update buyPrice.seller. As a result, the protocol is put in a deadlock situation where the new address cannot cancel the auction and withdraw their NFT without the compromised account first cancelling the buy price and vice-versa. This is only recoverable if the new account is migrated back to the compromised account and then cancelBuyPrice() is called before migrating back.
Recommended Mitigation Steps
Consider invalidating the buy offer before account migration.
NickCuso (Foundation) confirmed and commented:
Correct - if we were to use
adminAccountMigrationwhile the NFT had both an auction reserve price and had a buy price set this would have created a deadlock type situation where the NFT is in a bad state and we’d likely need to migrate the NFT back to the original owner in order to correct it.There were two possible solutions to this:
- Update
adminAccountMigrationto update both auction and buy price at the same time.- Cut
adminAccountMigrationcompletely.We went with the latter solution. This is not a feature we have used in some time and as we continue to grow, it’s not scalable since it required Foundation to get involved directly and included manual verification steps.
Removing this feature has saved over 2KB in contract space as well, which we really needed in order to make room for new features and changes.
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 adminAccountMigration function only updates the seller field in auction data and omits the seller field in buy price data.
Impact
If an NFT has both an auction and a buy price, migrating the account creates a deadlock where neither the old nor new address can cancel or withdraw without the other, potentially locking the NFT.
What the attacker needed
Operator role calls adminAccountMigration; NFT has both auction and buy price set
The fix
The adminAccountMigration feature was removed entirely, which also saved contract space.
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.
When an account is compromised, the operator can move a seller's auctions to a new address. But the code forgets to move the buy price listing too. So the old address still controls the buy price, and the new address controls the auction, and neither can fully cancel or withdraw without the other.
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.