Although denoted as deprecated, initRefs() is readily there in Referrals.sol that could be called by the owner whose private keys might have been compromised to reassign all the referral data. This could impact the referrers specifically who might have already put in a great effort referring a big pool of traders to Tigris Trade.
Note that the compromised or malicious owner might wait for a time when bytes32[] memory _ownedCodes and address[] memory _referredA have grown to big lists since initRefs() could only be called once because of isInit. To fully exploit the call, the owner would limit address[] memory _codeOwners and bytes32[] memory _referredTo all to himself or to addresses and codes under his control.
Recommended Mitigation Steps
It is recommended removing initRefs() and isInit from the contract to make the protocol more in full trust by the users.
Lines of code
https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/Referrals.sol#L60-L76
Vulnerability details
Impact
Although denoted as deprecated,
initRefs()
is readily there inReferrals.sol
that could be called by the owner whose private keys might have been compromised to reassign all the referral data. This could impact the referrers specifically who might have already put in a great effort referring a big pool of traders to Tigris Trade.Proof of Concept
Referrals.sol#L60-L76
Note that the compromised or malicious owner might wait for a time when
bytes32[] memory _ownedCodes
andaddress[] memory _referredA
have grown to big lists sinceinitRefs()
could only be called once because ofisInit
. To fully exploit the call, the owner would limitaddress[] memory _codeOwners
andbytes32[] memory _referredTo
all to himself or to addresses and codes under his control.Recommended Mitigation Steps
It is recommended removing
initRefs()
andisInit
from the contract to make the protocol more in full trust by the users.