The Tadle system's SystemConfig contract manages referral rates, which are used when creating new takers. However, there's a critical vulnerability in the interaction between the updateReferrerInfo() function and the createTaker() function. An attacker can front-run a legitimate user's createTaker() call by calling updateReferrerInfo() to lower the referrer rate, resulting in the legitimate user receiving less funds than expected.
The updateReferrerInfo() function allows any caller to modify anyone's referral rates:
This function can be called by anyone to update the referral rate for any address, as long as the caller is not setting their own rate. The vulnerability arises because there's no protection against front-running when a legitimate user attempts to create a new taker with an expected referral rate.
Alice, a legitimate user, prepares a transaction to create a new taker, expecting a 50% referral rate.
Bob, a malicious actor, monitors the mempool and sees Alice's pending createTaker() transaction.
Bob quickly submits a transaction with a higher gas price: updateReferrerInfo(Alice's address, 300_000, 0).
Bob's transaction is processed first, setting Alice's referrer rate to 30%.
Alice's createTaker() transaction is processed next, but now uses the 30% rate instead of the expected 50%.
Alice receives significantly less referral earnings than she should have.
Legitimate referrers receive lower referral fees than expected.
Implement a time-lock mechanism for rate changes.
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.