Users can’t repay their debts if the OmniPool contract is paused which can cause users to fall into liquidation and lose their collateral
Submitted by 0xStalin, also found by ladboy233 (1, 2)
Users can’t repay their debts if the OmniPool contract is paused which can cause users to fall into liquidation and lose their collateral
Proof of Concept
The OmniPool::repay() function has implemented the whenNotPaused modifier, which will prevent the function from being used if the contract is paused. The problem is that the usage of this function should not be prevented because if users are unable to repay their debts, their accounts can fall into liquidation status while the OmniPool contract is paused, and once the contract is unpaused, and liquidations are enabled too, if the account felt into liquidation status, now the users and liquidators will be in a mev run to either repay the debt or liquidate the collateral.
This presents an unnecessary risk to users by preventing them from repaying their debts.
OmniPool contract
//@audit-issue -> If contract is paused, this function can't be called if the contract is paused because of the whenNotPaused modifier!
function repay(uint96 _subId, address _market, uint256 _amount) external whenNotPaused {
...
}
Recommended Mitigation Steps
The mitigation is very straight forward, don’t disable the borrower’s repayments, and don’t interrupt the repayments. Remove the whenNotPaused modifier:
OmniPool contract
- function repay(uint96 _subId, address _market, uint256 _amount) external whenNotPaused {
//@audit-ok => Allow repayments even if the contract is paused!
+ function repay(uint96 _subId, address _market, uint256 _amount) external {
...
}
allenjlee (BetaFinance) confirmed and commented:
We will remove the
whenNotPausedmodifier forrepay
I think the root cause of this issue is that users are not able to repay when paused and the interest accrued may lead to the user’s account being unhealthy.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Beta Finance Invitational. Code4rena made it public on 6 December 2023. Found in the 2023-11-betafinance audit contest (finding M-02).
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.