The updateReferrerInfo(address,uint256,uint256)
function may be called arbitrarily to manipulate the outcome of platform fee accrual for other users, meanwhile the referral system itself is ineffective for incentivising other referrals.
In Tadle, the SystemConfig contract defines a referralInfoMap
which is used to modulate the distribution of platform fees between a referrer and authority.
The contents of each mapping element is as follows:
This object defines how core platform fees are distributed.
Notice then, that we can manipulate the ReferralInfo
through an unprotected call to updateReferrerInfo(address,uint256,uint256)
:
Notice here that since we are writing to referralInfoMap[_referrer]
and we are assigning referralInfo.referrer = _referrer
, an account may technically only ever refer to itself (even though we explicitly prevent the same account from modifying its own mapping entry, but this is easily bypassed by using a different wallet).
Users can grief other participants by defining a referrerRate
and authorityRate
combination which can affect the outcome of platform fee accrual, for example, by reducing a victim's share of due fee revenue. For example, an authority may front run the transaction to skew the distribution of fees entirely in their own favour by configurring referrerRate
to zero and the _authorityRate
to the sum of baseReferralRate + referralExtraRate
.
Additionally, it is impossible for an account to have a referral address which isn't their own, since:
This renders the incentive system ineffective.
Manual Review
When calling updateReferrerInfo(address,uint256,uint256)
, we should be writing to the msgSender()
's ReferralInfo
_ _object and not the _referrer
:
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.