When the canRepay status of pools inside InitCore is paused, users are not allowed to repay their positions when borrowing from the paused pool. However, interests continue to accrue during this pause period, exposing users to potential liquidation risk once the canRepay flag is allowed again.
Proof of Concept
It can be observed that when canRepay flag is set to false inside the config, users are not allowed to repaid his position.
This will allow the debt to continue growing while users cannot repay their positions, exposing the risk of getting liquidated once the canRepay status is allowed again by the admin.
Tools Used
Manual review
Recommended Mitigation Steps
Inside accrueInterest, check the canRepay status inside InitCore; if it's paused, return early and do not accrue the interest.
Lines of code
https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/core/InitCore.sol#L535 https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/lending_pool/LendingPool.sol#L155-L169
Vulnerability details
Impact
When the
canRepay
status of pools insideInitCore
is paused, users are not allowed to repay their positions when borrowing from the paused pool. However, interests continue to accrue during this pause period, exposing users to potential liquidation risk once thecanRepay
flag is allowed again.Proof of Concept
It can be observed that when
canRepay
flag is set to false inside the config, users are not allowed to repaid his position.https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/core/InitCore.sol#L530-L551
However,
accrueInterest
still can be called and not considering the status of repay inside theInitCore
contract.https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/lending_pool/LendingPool.sol#L155-L169
This will allow the debt to continue growing while users cannot repay their positions, exposing the risk of getting liquidated once the
canRepay
status is allowed again by the admin.Tools Used
Manual review
Recommended Mitigation Steps
Inside
accrueInterest
, check thecanRepay
status insideInitCore
; if it's paused, return early and do not accrue the interest.Assessed type
Invalid Validation