Skip to content
Business logic Audit finding Beginner

NFTXSimpleFeeDistributor#addReceiver: Failure to check for existing receiver

The addReceiver function does not check whether a receiver address already exists, allowing the same receiver to be added multiple times. This could cause that receiver to receive more fees than intended until the duplicate is removed.

GreyArt Follow

Originally disclosed on Code4rena

Submitted by GreyArt

The addReceiver() function fails to check if the _receiver already exists. This could lead to the same receiver being added multiple times, which results in erroneous fee distributions.

The receiver would receive more than expected (until the duplicate entry has been removed).

Recommended Mitigation Steps

Have a mapping address => bool isReceiver that will update whenever receivers are added, modified to a new address or removed.

0xKiwi (NFTX) acknowledged, but disagreed with medium severity and commented:

Valid concern, but this is a permissioned function.

LSDan (judge) commented:

I think this one is much more likely. I would suggest adding a check because the problem is easy to create and much harder to notice.


The original report as published on Code4rena, by GreyArt. 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 addReceiver function lacks a check to prevent duplicate receiver addresses.

Impact

A receiver added multiple times could receive more fees than expected until the duplicate entry is removed; the function is permissioned, so only an authorised caller can trigger it.

What the attacker needed

Permissioned function access

The fix

Add a mapping to track whether an address is already a receiver and update it when receivers are added, modified, or removed.

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.

A smart contract function that adds a fee receiver does not check if that receiver is already in the list. If the same receiver is added twice, it gets paid twice as much as it should. This is a simple missing check that can cause incorrect payments.

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 GreyArt

View all

12 more disclosed reports, best first.

More from NFTX contest

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.