The updateReferrerInfo function in the SystemConfig.sol contract incorrectly assigns the referrer of a user to the user themselves. This error prevents the proper distribution of referral fees, as the system fails to correctly identify the true referrer.
The updateReferrerInfo function is intended to set the referrer information for users in the Tadle protocol. However, the line referralInfo.referrer = _referrer; within the function assigns the user's own address as their referrer. This assignment is incorrect and disrupts the referral bonus mechanism, as it prevents the correct identification of the referrer who should receive the referral bonus.
This vulnerability has a high impact because it undermines the entire referral system of the protocol. Users who refer others to the platform will not receive the referral bonuses they are entitled to, potentially leading to loss of trust in the platform and a significant decrease in user engagement and growth.
This is the test code of the vulnerability.
The result is like this.
As you can see, referrer of user2 is set to itself, not to real referrer (user1). And the ReferralBonus is added to user2, not to user1.
Manual code review
To correct this issue, the function should be redesigned like this.
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.