The updateReferrerInfo function contains logic that could lead to confusion and potential misuse of the referral system. It updates referral information for a given referrer address, but includes a misleading self-referential assignment.
[Link to code](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/SystemConfig.sol#L69-L70)
Issues:
The function name suggests updating referrer info for the caller, but it actually updates info for the _referrer parameter.
Setting referralInfo.referrer = _referrer creates a self-referential entry, which is likely not the intended behavior.
The function allows any address to update referral information for any other address (except themselves), which could be a security risk.
[Link to code](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/SystemConfig.sol#L46-L48)
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.