In the SystemConfig::updateReferrerInfo
function, the referrer address is prohibited from modifying their own referral rate according to the NatSpec documentation. However, this restriction can be easily circumvented by invoking the function with a different address.
The function is designed to revert when the caller’s address matches the provided referrer address. Despite this, a caller can easily create a new address and call the function. Additionally, any user is capable of calling this function to modify the referral information of other users.
copy and paste the code below to file PreMartkets.t.sol
and run it.
• Likelihood: High
The vulnerability is easily exploitable since a caller can create a new address to bypass the restriction.
• Impact: Medium
A referrer could manipulate the referral bonus by altering the ratio between the referral rate and the authority rate. Moreover, any user can call this function to alter another user’s referral information.
Manual Review
If access control is necessary, it should be implemented by restricting function calls to authorized users, rather than blocking specific addresses. Blocking an address is ineffective as a malicious user can simply generate a new address to bypass the restriction.
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.