Submitted by IllIllI
A malicious authorized user can steal all unclaimed rewards and break the reward accounting
Even if the authorized user is benevolent the fact that there is a rug vector available may negatively impact the protocols reputation. Furthermore since this contract is meant to be used by other projects, the trustworthiness of every project cannot be vouched for.
By setting a booster that returns zero for all calls to boostedBalanceOf() where the user address is not under the attackers control, and returning arbitrary values for those under his/her control, an attacker can choose specific amounts of rewardToken to assign to himself/herself. The attacker can then call claimRewards() to withdraw the funds. Any amounts that the attacker assigns to himself/herself over the amount that normally would have been assigned, upon claiming, is taken from other users unclaimed balances, since tokens are custodied by the flywheelRewards address rather than per-user accounts.
FlywheelCore.sol#L182-L187
FlywheelCore.sol#L258-L266
FlywheelCore.sol#L119-L125
Projects also using BaseFlywheelRewards or its child contrats, are implicitly approving infinite transfers by the core
BaseFlywheelRewards.sol#L25-L31
The attacker need not keep the booster set this way - he/she can set it, call accrue() for his/her specific user, and unset it, all in the same block.
Make flywheelRewards immutable, or only allow it to change if there are no current users.
Joeysantoro (xTRIBE) commented:
0xean (judge) commented:
