The updateReferrerInfo function in the SystemConfig contract is not properly protected, allowing any user to override the referral information of any _referrer. This undermines the referral point system and can lead to significant issues such as the loss of commissions for legitimate referrers.
The root cause of the vulnerability is that the condition intended to protect the function, _msgSender() == _referrer, is incorrectly implemented, allowing unauthorized users to call this function while denying legitimate referrers the ability to update their rates.
Found in src/core/SystemConfig.sol at Line 46
@>: the function allows referrers to tweak their commission rates; however, the condition
_msgSender() == _referrerfails to prevent others from calling this function while denying the actual referrer the ability to update their rates.
Let us walk through the issue with the following scenario:
Alice, a legitimate referrer, attempts to update her commission rate using the updateReferrerInfo function.
Bob, a malicious user, identifies that the function allows him to update Alice's referral information due to the incorrect condition check.
As a result, Bob can set Alice's commission rate to zero and redirect the entire totalRate to the authority instead, effectively griefing Alice's earnings and undermining the referral system's integrity.
This vulnerability is severe as it compromises the integrity of the referral system. A malicious actor could exploit this flaw to manipulate referral rates, potentially redirecting earnings from legitimate referrers to the authority party, causing financial losses and damaging the platform's trust.
Manual Review
Correct the condition in the updateReferrerInfo function to ensure that only the legitimate referrer can update their referral information:
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.