Skip to content
Business logic Audit finding Intermediate

Primary seller can avoid paying the primary fee

The Foundation NFT marketplace charges a 15% fee on primary sales and 5% on secondary sales, but the conditions for a primary sale can be bypassed by the seller. An attacker could transfer the NFT to another wallet or make a private sale to themselves for a tiny amount, then sell publicly as a secondary seller, paying only 5% instead of 15%.

pedroais Follow

Originally disclosed on Code4rena

Submitted by pedroais, also found by leastwood and WatchPug

A primary seller can circumvent the 15% fee and pay 5% as a secondary seller.

Context

The Foundation protocol charges a 15% fee if the sale is a primary sale and 5% if it’s a secondary sale. https://github.com/code-423n4/2022-02-foundation/blob/4d8c8931baffae31c7506872bf1100e1598f2754/contracts/mixins/NFTMarketFees.sol#L40

There are 2 conditions that must be met for a sale to be considered primary:

  1. The seller is one of the creators in the NFT metadata.
  2. It’s the first time this NFT is sold on the foundation protocol.

https://github.com/code-423n4/2022-02-foundation/blob/4d8c8931baffae31c7506872bf1100e1598f2754/contracts/mixins/NFTMarketFees.sol#L188

Proof of Concept

Both of these conditions can be easily circumvented by the primary seller.

  1. He could transfer the NFT to a different wallet and sell it from there to break the first condition.
  2. He can make a private sale to himself for 1$ (paying the 15% fee on a dust amount) and then do a public auction with the real price.

With any of these 2 methods, the primary seller can circumvent the 15% fee and pay 5% as a secondary seller which makes the primary seller fee optional to pay.

NickCuso (Foundation) acknowledged amd commented:

Yes, this is possible. It’s a good limitation to note and we should have it called out as a known issue / potential abuse path.

It’s not clear how we could avoid this though while still keeping primary fees around - so I think all we can do is document it for now. This has been true since our launch a year ago and we are not aware of anyone abusing it yet. We think that’s because NFT provenance is very important, so if it was being sold from a different account than the creator it’s possible that would not get as much attention and potentially sell for less than they could have gotten accepting the primary sale fee.


The original report as published on Code4rena, by pedroais. 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

Likely the fee logic relies on mutable on-chain conditions (seller address and sale history) that the seller can manipulate before the real sale.

Impact

The primary seller could avoid paying the full 15% fee and pay only 5%, reducing the platform's revenue; the platform acknowledges this is possible but notes no known abuse.

What the attacker needed

Seller is the NFT creator; ability to transfer NFT or make private sale

The fix

The platform should document this as a known limitation, as they state it is not clear how to avoid it while keeping primary fees.

How it was found

  1. Transfer the NFT to a different wallet to break the condition that the seller is a creator.
  2. Alternatively, make a private sale to yourself for a very small amount, paying the 15% fee on that small amount.
  3. Then conduct a public auction at the real price, which is now treated as a secondary sale with a 5% fee.

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 you sell an NFT for the first time on a marketplace, the platform takes a bigger cut (15%) than on later sales (5%). This report shows that the seller can avoid the bigger cut by first selling the NFT to themselves for almost nothing, or by moving it to another wallet, so the next sale counts as a later sale. The platform loses part of its fee.

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 pedroais

View all

6 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.