referrer cannot update its rates via systemConfig.updateReferrerInfo but any address can do it for the referrer.
systemConfig.updateReferrerInfo is meant to be used by the referrer to update its _referrerRate and _authorityRate but it cannot call the function to update to its preferred rates. However any random address can call the function and update the rates for the referrer. This is because of the check below which reverts if msg.sender == referrer.
Since this is not an admin function, i believe the check should be msg.sender != referrer instead as this allows the referrer to only change its own rates and prevents any other random address/malicious address from changing rates for another referrer address to whatever it wants.
paste code in new file created in /test folder
run with forge test
referrer cannot update its rates via systemConfig.updateReferrerInfo but any address can do it for the referrer. This means no restriction to storage values and allows for unfair manipulation of a referrer's rates and the referrer is unable to prevent it/remedy the situation.
foundry
change the check to
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.