Skip to content
Business logic Audit finding Intermediate

FeeSplitter: No sanity check to prevent shareholder from being added twice.

The FeeSplitter contract allows the same shareholder to be added multiple times because the setShareholders function does not check for duplicates. An attacker could add duplicate shareholders, causing them to receive more fees than intended when _sendFee is called.

GreyArt Follow

Originally disclosed on Code4rena

Submitted by GreyArt, also found by hack3r-0m

Impact

It is possible for duplicate shareholders to be added. These shareholders will get more than intended when _sendFee() is called.

Recommended Mitigation Steps

Ensure that the _accounts array is sorted in setShareholders().

for (uint256 i = 0; i < _accounts.length; i++) {
	if (i > 0) {
		require(_accounts[i - 1] < _accounts[i], "FeeSplitter: ACCOUNTS_NOT_SORTED");
	}
	_addShareholder(_accounts[i], _weights[i]);
}

adrien-supizet (Nested) commented:

Duplicate #231

adrien-supizet (Nested) commented:

Indeed there is a fix to do here, we’ll prevent adding the same shareholders instead as suggested in #231

alcueca (judge) commented:

Taking this issue as the principal, and raising #231 to medium severity.

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 setShareholders function does not verify that the provided accounts are unique, allowing duplicates to be added.

Impact

Duplicate shareholders could receive more fees than intended when fees are distributed.

What the attacker needed

Ability to call setShareholders

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 lets people share fees. If the same person is added twice, they get paid twice. The contract didn't check for duplicates, so someone could add the same address multiple times and take more fees.

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