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