Tadle

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

Weak Access Control Allows Referrers to Seize All Fees from Authorities

Summary

A flaw in the access control implementation allows referrers to manipulate their referral information and claim all the rewards intended for both the authority and the referrer.

Vulnerability Details

In the SystemConfig::updateReferrerInfo function, users are permitted to adjust the _referrerRate and _authorityRate values for themselves and their referrer.

Key Code Section:

  1. The function includes a check to prevent the _referrer from adjusting these properties:

function updateReferrerInfo(
address _accountAddress,
address _referrer,
uint256 _referrerRate,
uint256 _authorityRate
) external onlyOwner {
if (_msgSender() == _referrer) {
revert InvalidReferrer(_referrer);
}
referrerInfo[_accountAddress] = ReferrerInfo({
referrer: _referrer,
referrerRate: _referrerRate,
authorityRate: _authorityRate
});
emit UpdateReferrerInfo(
_accountAddress,
_referrer,
_referrerRate,
_authorityRate
);
}
  1. The check is designed to prevent the referrer from directly adjusting their referrerRate and authorityRate values to capture all the fees meant for both themselves and the authority.

The Issue:

While the current check prevents referrers from directly making these changes, it is ineffective because the referrer can simply create a separate address to bypass this restriction. By using a new address, the referrer can set their desired _referrerRate and _authorityRate, effectively claiming all the fees that should have been shared.

Exploit Scenario:

  1. A referrer creates a secondary address.

  2. The referrer uses this address to update their referralInfo, setting a high _referrerRate and a low _authorityRate.

  3. As a result, the referrer can claim all the rewards meant for both the authority and the referrer, leaving the authority with nothing.

Impact

This vulnerability leads to a loss of funds for the authority, as the referrer can effectively grief the authority by claiming all the rewards meant for both parties.

Tools Used

Manual

Recommendations

  1. Restrict Access: Only allow the owner and the authority to update the referralRate related to their accounts.

  2. Enhance Validation: Implement additional checks to ensure that referrers cannot indirectly manipulate their referral information through other accounts.

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.