According to the natspec of updateReferrerInfo()
the function is not supposed to be called by the referrer
, so that
people don't go on setting referral for themselves.
Code snippet:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/SystemConfig.sol#L38-L52
However, anyone user can simply use another wallet address to bypass this system and set referral for themselves.
This will cause severely impact the protocol as none of the users will be able earn any authorityRate
Given that authorityRate
can be highly incentivised by the referrer
so that more and more users use their referral link, this will break the system.
Suppose user1
wants to call updateReferrerInfo
with referrer
as user1
and then the corresponding authorityRate
and referrerRate
, as per the code snippet this will be prevented.
However, user1
can simply use another wallet, lets call it cibilWallet
and use that wallet to call the function.
In this case the _msgSender()
will be cibilWallet
where as the referrer will be user1
and this will pass.
This breaks the intended functionality of the protocol.
One solution could be that instead of users setting the referral information, the referrers should set this information and then add the referred people to a mapping referrerToReferred
, this mapping can then be used to validate such referral data.
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.