Closed sherlock-admin4 closed 6 months ago
This issue is invalid following the Sherlock guidelines:
An admin action can break certain assumptions about the functioning of the code. Example: Pausing a collateral causes some users to be unfairly liquidated or any other action causing loss of funds. This is not considered a valid issue.
coffiasd
high
Borrower repayment of assets is subject to pausable limitations
Summary
Borrower repayment of assets is subject to pausable limitations, which can result in an inability to repay when prices drop
Vulnerability Detail
Market.sol::repay Market.sol::refund Market.sol::repayAtMaturity The above repayment function includes a
whenNotPaused
check. Assuming the following scenario:After the PAUSER_ROLE unpauses the contract, the borrower intends to repay DAI to the contract. However, a liquidator can front-run to liquidate the borrower's position, which is unfair to the loan holder.
Add following test to file
Market.t.sol
As we can see borrower unable to repay eth, when owner
unpause
the contract , borrower's position can be front-run to liquidated.Impact
Code Snippet
https://github.com/sherlock-audit/2024-04-interest-rate-model/blob/main/protocol/contracts/Market.sol#L176-L183 https://github.com/sherlock-audit/2024-04-interest-rate-model/blob/main/protocol/contracts/Market.sol#L190-L197 https://github.com/sherlock-audit/2024-04-interest-rate-model/blob/main/protocol/contracts/Market.sol#L445-L458
Tool used
Manual Review
Recommendation
delete
whenNotPaused
limitation in repay assets function