A portion of the platform fee charged on each trade can be directed to a referrer, as designated by the user. The referrer must be a different address from the caller to prevent users from claiming the entire referral bonus themselves. However, there is a flaw in the way this referrer address is set: the referrer information is stored in the referrer's mapping instead of the caller's. As a result, every user's referrer becomes themselves, rendering the entire referral system ineffective.
The following code snippet from the updateReferrerInfo
function illustrates the issue:
In this code, the referral information is stored using the _referrer
address as the key, instead of the function caller's address. Consequently, the referrer address is incorrectly set to the user's own address, along with the associated rates, which negates the intended functionality of the referral system.
See PoC below:
Manual review.
Store information using _msgSender()
key:
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.