Skip to content
Business logic Audit finding Intermediate

Users can dodge `createListing` fees

A loophole in the listing fee mechanism allows users to create listings with reduced tax by reserving and liquidating their own listing, and to relist expired listings for free. An attacker could evade fees and hijack tokens at floor value.

Ollam Follow with OpaBatyo, ZeroTrust and 2 others

Originally disclosed on Sherlock

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

Found by

Ollam, OpaBatyo, ZeroTrust, valuevalk, zzykxx

Summary

Users can abuse a loophole to create a listing for 5% less tax than intended, hijack others' tokens at floor value and perpetually relist for free.

Vulnerability Detail

For the sake of simplicity, we assume that collection token denomination = 4 and floor price = 1e22

Users who intend to create a dutch listing for any duration <= 4 days can do the following:

  1. Create a normal listing at min floor multiple = 101 and MIN_DUTCH_DURATION = 1 days, tax = 0.1457% (tokensReceived = 0.99855e22)
  2. Reserve their own listing from a different account for tokenTaken 0.95e18, collateral 0.05e18, collateral is burnt, protected listing is at 0 health and will be liquidatable in a few moments (remainingTokens = 0.94855e22)
  3. Liquidate their own listing through liquidateProtectedListing, receive KEEPER_REWARD = 0.05e22 (remainingTokens = 0.99855e22)
  4. createLiquidationListing is invoked with us as owner and hardcoded values floorMultiple = 400 and duration = 4 days

User has paid 0.14% in tax for a listing that would've normally cost them 5.14% in tax. This process can be repeated any number of times even after the liquidationListing expires to constantly reserve-liquidate it instead of calling relist and paying further tax.

There are numerous other ways in which this loophole of reserve-liquidate can be abused:

  1. Users can create listings for free out of any expired listing at floor value, they only burn 0.05e18 collateral which is then received back as KEEPER_REWARD
  2. Users can constantly cycle NFTs at floor value (since it is free) and make liquidationListings, either making profit if the token sells or making the token unpurchasable at floor since it is in the loop
  3. Any user-owned expired listing can be relisted for free through this method instead of paying tax by invoking relist

Impact

Tax evasion

Code Snippet

Solidity
        _listings.createLiquidationListing(
            IListings.CreateListing({
                collection: _collection,
                tokenIds: tokenIds,
                listing: IListings.Listing({
                    owner: listing.owner,
                    created: uint40(block.timestamp),
                    duration: 4 days,
                    floorMultiple: 400
                })
            })
        );

Tool used

Manual Review

Recommendation

Impose higher minimum collateral and lower tokenTaken (e.g 0.2e18 and 0.8e18) so the KEEPER_REWARD would not cover the cost of burning collateral during reservation, making this exploit unprofitable.

The original report as published on Sherlock, by Ollam. 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 collateral and tokenTaken values in the reserve function allow the keeper reward to offset the burned collateral, making the reserve-liquidate cycle profitable for fee evasion.

What the attacker needed

Ability to create a listing; a second account to reserve; sufficient tokens for reserve and liquidation

The fix

Impose higher minimum collateral and lower tokenTaken so the keeper reward does not cover the cost of burning collateral during reservation.

How it was found

  1. Create a normal listing with minimum floor multiple and minimum Dutch duration.
  2. Reserve the listing from a different account, paying tokenTaken and collateral.
  3. Liquidate the protected listing to receive the keeper reward.
  4. A liquidation listing is automatically created with hardcoded values.

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.

This report describes a way to avoid paying the full fee when listing an NFT for sale. By using a series of actions (reserving and then liquidating their own listing), a user pays much less tax than intended, and can even relist expired items for free.

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.