The distributeAssets
function allows anyone to increase the rewards of any holders for any token/symbol without providing the tokens that correspond to the token symbol provided. Can aslo decrease the euros of any user's position and burn all euros held by pool.
If distributeAssets
is called by a user that is not the manager they can set the asset to anything.
A user sets the asset amount > 0, asset.token.addr == address(0) and asset.token.symbol set to a token that is one of the acceptedTokens.
The asset.token.clAddr can be set to a contract to return any amount for assetPriceUsd.
If assetPriceUsd always returns 0 then costInEuros is 0 and all positions keep their euros and no euros are burned. All holders will receive their portion of rewards based on the asset.amount (controlled by attacker) and their stake. costInEuros could also be set to 0 by just passing 0 as the _hundredPC to the function.
assetPriceUsd and asset.amount could be set such that burnEuros burns entire pool's euro balance and all users lose their positions' EUROs. This can also be more simply done by setting the _hundredPC value to a very high number.
Rewards will be based on token.symbol's address in TokenManager's AcceptedTokens, not on the address given by attaker for asset.token.
Token addr can be set to address(0) so only nativePurchased increases instead on transferring tokens from manager. NativePurchased will be capped by asset.amount so amount sent back to manager contract can be 0. Attacker can avoid paying for distributed asset.
An attacker could increase rewards arbitrarily for anyone and any token and steal any and all reward tokens without providing any assets.
The attacker could also decrease the euros of positions without providing assets to the pool.
Manual review.
Consider only allowing the manager to call distributeAssets or check the values being passed to the function. Would need to check the tokens are accepted tokens and that the addr corresponds to the correct symbol in AcceptedTokens. Also the clAddr must be checked to be a real chainlink feed. Maybe use whitelisted addresses for feeds.
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.