Skip to content
Business logic Audit finding Intermediate

`CollectionShutdown::execute()` doesn't ensure that all locked NFTs are sold

The CollectionShutdown::execute() function does not verify that all locked NFTs are included in the array of token IDs to be sold. An attacker could deposit an NFT after the admin's transaction is submitted, causing that NFT to remain locked and unsold, leading to indirect loss of funds for collection token holders.

IMAFVCKINSTARRRRRR Follow with McToady and zzykxx

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-08-flayer-judging/issues/502

Found by

IMAFVCKINSTARRRRRR, McToady, zzykxx

Summary

No response

Root Cause

CollectionShutdown::execute() doesn't ensure that all tokens of the collection being shutdown are added to the sudoswap pool in order to be sold.

This function takes as input an array of the token IDs to be sold via sudoswap pool. In case an NFT ID that's locked in the protocol is not in this array the NFT will stay locked and not sold.

Even if the function is only callable by admins the admins have no control on the order and the moment transactions are executed and such scenarios should be handled at the moment of execution.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

  1. The protocol currently holds NFTs 55 and 56, admin calls CollectionShutdown::execute() by passing as a parameter [55,56].
  2. While the CollectionShutdown::execute() transaction is in the mempool a deposit of NFT 60 is done via Locker::deposit().
  3. The CollectionShutdown::execute() transaction goes through and a sudoswap pool selling 55 and 56 is created
  4. NFT 60 is locked in the protocol

Impact

NFTs that should be sold are locked in the procotol, which leads to an indirect loss of funds to collection tokens holders.

PoC

No response

Mitigation

In CollectionShutdown::execute() make sure all tokens currently locked in the protocol are added to the sudoswap pool.

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

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 function relies on a caller-supplied list of token IDs without checking that it covers all currently locked NFTs, so any NFT locked after the list is created is omitted.

Impact

NFTs that should be sold remain locked in the protocol, which leads to an indirect loss of funds to collection token holders.

What the attacker needed

Admin calls execute(); attacker deposits NFT during mempool wait

The fix

The function should be modified to ensure that all tokens currently locked in the protocol are added to the sudoswap pool.

How it was found

  1. The protocol holds NFTs 55 and 56; admin calls CollectionShutdown::execute() with parameter [55,56].
  2. While the execute() transaction is in the mempool, a deposit of NFT 60 is made via Locker::deposit().
  3. The execute() transaction goes through and a sudoswap pool selling 55 and 56 is created.
  4. NFT 60 remains locked in the protocol.

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 a collection is shut down, the admin lists which NFTs to sell. If a new NFT is locked in the protocol after the admin prepares the list but before the transaction is processed, that NFT is not included and stays stuck. This means some NFTs are never sold, which can cause financial loss for people holding collection tokens.

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 from Flayer

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.