Pool fee percentage can be set to a value that will break the fee distribution mechanism.
The owner of the LiquidationPoolManager can modify the poolFeePercentage through the
setPoolFeePercentage function. The poolFeePercentage is then used in thedistributeFees
function to calculate the amount of tokens to send to the LiquidationPool.
If poolFeePercentage > HUNDRED_PC, then the amount to send to the LiquidationPool will be greater
than the current balance of the LiquidationPoolManager. Then during the call to the LiquidationPool,
safeTransferFrom will revert and fees will not be distributed.
Denial of service of fee distribution
Scope:
Scope:
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/LiquidationPoolManager.sol#L84-L86
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/LiquidationPoolManager.sol#L35
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/LiquidationPoolManager.sol#L38
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/LiquidationPool.sol#L185
The following unit test shows the vulnerability.
Consider checking that the _poolFeePercentage <= HUNDRED_PC in the setPoolFeePercentage function.
This can be done by replacing the setPoolFeePercentage function by the following code:
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.