SystemConfig::updateReferrerInfo allows any address (except the referrer) to update referral rates. While there are safeguards to ensure the referrer's rate doesn't fall below the base rate, this still allows anyone else to potentially manipulate of fee distribution.
An attacker could set up a separate account to update their own referral rates, potentially allocating up to 70% of the referral fees to themselves as the "authority". This could lead to unfair distribution of referral fees.
Let's introduce Alice (attacker) and Bob (maker/offer owner) to the attack scenario.
Before Bob settles an offer, Alice could her referral fee to 100% and get all of the fees for herself whenever Premarkets::_updateReferralBonus executes.
Manual review
While there's an argument that this will be resolved by enforcing access control on the client, there's no clear way to resolve the issue on the smart contract itself. Here are some ideas though:
Enforce a maximum referrer rate (e.g., 70% of total rate) to ensure some fees always go to the authority or protocol.
Implement access control on the updateReferrerInfo function, allowing only authorized addresses (e.g., admin or governance) to update referral rates.
Consider implementing a timelock or a cooldown period for rate changes to prevent rapid manipulations and so that the offer maker could react to fee updates and inform authorized bodies of the update.
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.