https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/SystemConfig.sol#L41-L80
The updateReferrerInfo function in the SystemConfig contract lacks proper access control, allowing any external user to call the function and alter the referral settings, including rates for referrers and authorities. This vulnerability could be exploited by malicious actors to manipulate referral data.
The function is marked as external, meaning it is accessible by any user or contract interacting with it. The only condition checked is whether the _msgSender() is the same as _referrer, which only prevents the referrer from updating their own information but does not restrict other users from doing so. The absence of a restrictive modifier like onlyOwner or a dedicated access control mechanism allows unauthorized users to update referral information.
Malicious users can arbitrarily change referral rates, increasing their gains or negatively impacting other users' earnings. Such vulnerabilities can harm the platform's reputation by undermining user trust in the referral system's fairness and security.
Manual review
Use the onlyOwner modifier from OpenZeppelin's Ownable library to restrict access to the function, ensuring only the contract owner or a designated authority can update referral information or introduce additional checks to verify the legitimacy of the caller, such as a whitelist or specific administrative verification process, ensuring that only trusted entities can update sensitive referral settings.
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.