Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: high
Valid

`ReferralContract::updateReferrerInfo` - Lack of Access Control Allows Unauthorized Referrer Updates

Summary

The updateReferrerInfo function in the SystemConfig.sol contract lacks proper access control, allowing any user to call the function and update the referrer information, only The Refferer its self can't call it. This can lead to unauthorized manipulation of referral rates, which could result in financial losses or unfair distribution of rewards

Vulnerability Details

The updateReferrerInfo function is currently marked as external, allowing any account to call it. The only restriction is that the caller cannot be the same as the referrer being updated. This design allows for potential abuse:

function updateReferrerInfo(
address _referrer,
uint256 _referrerRate,
uint256 _authorityRate
) external {
if (_msgSender() == _referrer) {
revert InvalidReferrer(_referrer);
}
if (_referrer == address(0x0)) {
revert Errors.ZeroAddress();
}
if (_referrerRate < baseReferralRate) {
revert InvalidReferrerRate(_referrerRate);
}
// reste of code
}

  1. An attacker could update referrer information for any address without proper authorization.

  2. Legitimate referrers could have their rates modified without their consent.

  3. The contract owner has no control over who can modify referral settings.

A malicious actor could exploit this by:

  1. Creating multiple accounts

  2. Using one account to set favorable referral rates for another

  3. Potentially manipulating the referral system

Impact

This vulnerability could lead to unauthorized users manipulating referral rates, resulting in financial losses for the protocol. Malicious actors could decrease their referral rates without proper authorization, skewing the distribution of rewards and undermining the integrity of the referral system.

Tools Used

Manual code Review
Foundry

Recommendations

Add access control to the updateReferrerInfo function. This could be done by:

  • Adding an onlyOwner modifier to restrict access to the contract owner.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year 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.