Skip to content
Business logic Audit finding Intermediate

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.

leastwood Follow

Originally disclosed on Code4rena

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 adminAccountMigration while 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 adminAccountMigration to update both auction and buy price at the same time.
  • Cut adminAccountMigration completely.

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.


The original report as published on Code4rena, by leastwood. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by leastwood

View all

70 more disclosed reports, best first.

More from Foundation Exhibition, Scheduling & Early Access Solo Audit by Lambda

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.