The SystemConfig.updateReferrerInfo
function permits any user to set up referral rates for any referrer address without sufficient restrictions. This opens up the system to exploitation, where a user can create an alt account, assign it an inflated referral rate, and use it to unjustly claim higher referral bonuses.
The updateReferrerInfo
function in the SystemConfig
contract allows any user to specify a referral rate for any address.
There are no ownership checks to confirm that the caller owns the referrer address being updated, allowing any user to create and update referral rates for any address.
A malicious user can create an alt account, assign it as a referrer, and set an inflated referral rate, leading to the alt account earning a significant amount of referral bonuses during subsequent trades.
This vulnerability break this invariant that _msgSender() != _referrer in a referral system in a indirect way, where the referrer should be different from the caller to prevent self-referral abuse.
This vulnerability allows users to:
Create alt accounts and set high referral rates, enabling them to earn excessive referral bonuses.
Thus same user can uses multiple accounts to earn more referral bonus for themselves while trading as maker/taker.
Alice has two accounts: Main Account (Alice_Main
) and Alt Account (Alice_Alt
).
Alice uses Alice_Main
to call the updateReferrerInfo
function, assigning Alice_Alt
as a referrer with an abnormally high referral rate.
Alice performs trades using Alice_Main
that trigger referral bonuses.
Alice_Alt
receives referral bonuses based on the inflated rate set by Alice_Main
.
Alice effectively uses her alt account to collect excessive referral bonuses.
This exploitation can be repeated, multiple trades to get more referral bonus for the same user.
Manual Review
Foundry
Introduce a validation mechanism in the updateReferrerInfo
function to ensure that referral rate updates can only be made by the owner of the referrer address.
Implement a whitelisting mechanism to restrict the addresses that can be set as referrers, preventing the creation of alt accounts for referral bonus manipulation.
Valid high severity. There are two impacts here due to the wrong setting of the `refferalInfoMap` mapping. 1. Wrong refferal info is always set, so the refferal will always be delegated to the refferer address instead of the caller 2. Anybody can arbitrarily change the referrer and referrer rate of any user, resulting in gaming of the refferal system I prefer #1500 description the most, be cause it seems to be the only issue although without a poc to fully describe all of the possible impacts
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.