Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: high
Valid

`SystemConfig.updateReferrerInfo` lacks of access control

Summary

SystemConfig.updateReferrerInfo is used to update the bonus between authority and referrer, however because SystemConfig.updateReferrerInfo doesn't have access control, the referralInfoMap can be set by anyone

Vulnerability Details

As shown in the following code, the SystemConfig.updateReferrerInfo doesn't have access control, which means it can be called by anyone

41 function updateReferrerInfo(
42 address _referrer,
43 uint256 _referrerRate,
44 uint256 _authorityRate
45 ) external {
46 if (_msgSender() == _referrer) {
47 revert InvalidReferrer(_referrer);
48 }
49
50 if (_referrer == address(0x0)) {
51 revert Errors.ZeroAddress();
52 }
53
54 if (_referrerRate < baseReferralRate) {
55 revert InvalidReferrerRate(_referrerRate);
56 }
57
58 uint256 referralExtraRate = referralExtraRateMap[_referrer];
59 uint256 totalRate = baseReferralRate + referralExtraRate;
60
61 if (totalRate > Constants.REFERRAL_RATE_DECIMAL_SCALER) {
62 revert InvalidTotalRate(totalRate);
63 }
64
65 if (_referrerRate + _authorityRate != totalRate) {
66 revert InvalidRate(_referrerRate, _authorityRate, totalRate);
67 }
68
69 ReferralInfo storage referralInfo = referralInfoMap[_referrer];
70 referralInfo.referrer = _referrer;
71 referralInfo.referrerRate = _referrerRate;
72 referralInfo.authorityRate = _authorityRate;
73
74 emit UpdateReferrerInfo(
75 msg.sender,
76 _referrer,
77 _referrerRate,
78 _authorityRate
79 );
80 }

Impact

As shown in the above, the SystemConfig.updateReferrerInfo doesn't have access control, which means it can be called by anyone

Tools Used

VS

Recommendations

Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-SystemConfig-updateReferrerInfo-msgSender

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

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.