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.
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
Taking this issue as the principal, and raising #231 to medium severity.
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.