Open c4-bot-3 opened 3 months ago
MarioPoneder marked the issue as primary issue
Seems like a valid concern, @thorseldon could you please provide more context concerning you dispute?
After a second thought, this seems to fall below Centralisation Risk on Contracts which has Owner or Administrator.
according to the README
.
MarioPoneder marked the issue as unsatisfactory: Invalid
After a third thought, this is exceeding centralization risks, since it's never a good time to change asset collateral params. The params should be cached for ongoing borrows.
MarioPoneder marked the issue as satisfactory
MarioPoneder marked the issue as selected for report
This a parameter configuration which controlled by the DAO governance, any parameters like liquidation threshold should be carefully discussed and reviewed the community and dev team.
We will use timelock to schedule the configuration updating if the proposal voting is passed.
And this finding looks like same with https://github.com/code-423n4/2024-07-benddao-findings/issues/25.
I understand the centralization concern of this issue is out of scope and changes are carefully reviewed.
However, on a contract level:
For these reasons, Medium severity seems justified.
Lines of code
https://github.com/code-423n4/2024-07-benddao/blob/main/src/modules/Configurator.sol#L147-L163
Vulnerability details
Description
One of the key concepts in this protocol is Cross Lending when the contract will calculate the health-factor of the account, If it is unhealthy the liquidator can repay the debt on behalf of the borrower and take their collateral assets at a certain discount price.
The protocol has two main factors to calculate the health-factor for users, The
collateralFactor
andliquidationThreshold
values are unique for each pool and asset. Also, The Pool Admin can update them at any time by triggeringConfigurator.sol#setAssetCollateralParams()
The responsibility for computing health-factor is
GenericLogic.sol#calculateUserAccountData()
, which Calculates the user data across the reserves.However, the current logic uses
liquidationThreshold
value also to check if the asset will not be used as collateral (but still, users can supply/lend it to be borrowed and earn interest)The issue is the PoolAdmin can call
Configurator.sol#setAssetCollateralParams()
at any time to disable accepting an asset as collateral by updatingcollateralFactor
andliquidationThreshold
to zero value. So, users suddenly will get liquidated directly by MEV bots.Impact
setAssetCollateralParams()
transaction to liquidate users, They have no chance to update their positions.Proof of Concept
Foundry PoC:
Please copy the following POC in
TestIntCrossLiquidateERC20.t.sol