Open hats-bug-reporter[bot] opened 1 year ago
Sorry for the miscommunication: liquidation calls can be called by anyone. We do not enforce checks that blacklisted users cannot perform liquidation calls, as the blacklisted user could easily just create another address and use that new address to call liquidation.
No problem.. thanks for clarifying
Github username: @aktech297 Submission hash (on-chain): 0x72efe4c83407a5113a95a8c1376e62b4225561427d9a2777fddd53bdf6be3d50 Severity: high severity
Description: Summary : For
`liquidationCall
, blacklisted liquidators are not allowed. This was checked with sponsor and the same can be seen in the natspec comments. // note: liquidators should not be restricted to whitelisted users and ban blacklisted users.But, this check can be bypassed by passing the
bool receiveAToken
as false.Issue details:
wehn we look at the call flow when receiveAToken is set true
liquidationCall -> liquidationCall -> transferOnLiquidation
for both borrower as well as for liquidator, the blacklisted check is done inside the
transferOnLiquidation call.
transferOnLiquidation -> _transfer.-> finalizeTransfer
The blacklisted chedk is inside the
finalizeTransfer
call..But, when
receiveAToken
is set as false, following logic will be executed inside theliquidationCall
https://github.com/hats-finance/VMEX-0x050183b53cf62bcd6c2a932632f8156953fd146f/blob/fb396a3fa412e643de7d8a1fd8a0268ab3a2f993/packages/contracts/contracts/protocol/lendingpool/LendingPoolCollateralManager.sol#L250-L268
There are no check to validate for the blacklisted liquidator.
Note : since the validate flag is set to false inside the function call, transferOnLiquidation
Impact :
Blacklisted check will not prevent the calling of the liquidation call by the blacklisted user.
Fix :
We suggest to add the blacklist check inside the function call
liquidationCall