Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2023-05-venus/blob/main/contracts/Comptroller.sol#L469-L472
File: Comptroller.sol 469 uint256 maxClose = mul_ScalarTruncate(Exp({ mantissa: closeFactorMantissa }), borrowBalance); 470 if (repayAmount > maxClose) { 471 revert TooMuchRepay(); 472 }
When repayAmount > maxClose, liquidation occurs revert. Attackers can use this mechanism to front-run liquidate a little wei to avoid liquidation.
repayAmount > maxClose
manual
It is recommended that if the liquidation quantity exceeds the upper limit, the liquidation quantity takes the upper limit value.
DoS
0xean marked the issue as duplicate of #255
0xean marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2023-05-venus/blob/main/contracts/Comptroller.sol#L469-L472
Vulnerability details
Impact
When
repayAmount > maxClose
, liquidation occurs revert. Attackers can use this mechanism to front-run liquidate a little wei to avoid liquidation.Proof of Concept
Tools Used
manual
Recommended Mitigation Steps
It is recommended that if the liquidation quantity exceeds the upper limit, the liquidation quantity takes the upper limit value.
Assessed type
DoS