The runLiquidation function inside the LiquidationPoolManager contract is used to liquidate a vault and distribute all the collateral assets among the stakers inside the LiquidationPool contract by calling distributeAssets. The stakers do not get the collateral tokens for free, they need to buy them (for a discount) with EURO tokens.
The distributeFees distributes fees in EURO tokens among all stakers. Therefore, the runLiquidation function calls distributeFees before distributing the collateral tokens with distributeAssets as the aquired EURO tokens from the fees can influence how many collateral tokens each staker gets.
However, the distributeAssets function is an external function and can be called directly by anyone. If someone calls distributeAssets directly, the function will not call distributeFees as only runLiquidation does, and therefore the assets are most likely distributed in an unfair split, as the fees were not acquired.
All the functions inside the LiquidationPool contract call consolidatePendingStakes(); and ILiquidationPoolManager(manager).distributeFees(); before interacting with any staking position to update the position to the current state. Except from distributeAssets which only calls consolidatePendingStakes(); and therefore does not distribute the fees before distributing the assets.
The reason for that is that distributeAssets is normally called by runLiquidation which already calls distributeFees before calling distributeAssets. However, distributeAssets is an external function and can be called by anyone. If someone calls distributeAssets directly, the function will not call distributeFees and therefore the assets are most likely distributed in an unfair split, as the fees were not acquired.
Here we can see that distributeAssets can be called by anyone and that it does not call distributeFees to update the current EURO value of the staking positions:
Unfair distribution of assets among stakers.
The distributeAssets function should be restricted to only be callable by the LiquidationPoolManager contract.
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.