#47009 [SC-Low] Any position can be closed (by repaying the debt) even after the maturity date has passed
Description
Brief/Intro
Vulnerability Details
function createSettlement(
string memory _settlementId,
SettleInfo calldata _settleInfo,
string[] memory _loanIds,
LoanInfo[] calldata _loans,
bytes calldata _signature
) external nonReentrant {
.....
// storage
struct LoanInfo {
bytes32 settlementId; // ID of the settlement this loan belongs to
address maker; // who created the loan
address lender; // who provides the funds
address borrower; // who receives the funds(borrow)
address collateralTokenAddr; // address of the collateral token
address debtTokenAddr; // address of the debt token
DebtData debtData;
bool settled; // has the loan been settled
}
struct DebtData {
uint256 collateralAmt; // amount of the collateral
uint256 debtAmt; // debt amount
uint256 borrowedAmt; // how muhch borrowed
uint256 feeAmt; // fee to pay to the protocol
uint64 maturity; // when the loan matures
uint32 lltv; // loan to value liquidation ratio in basis point
uint32 mltv; // maximum loan to value
}
Impact Details
Recommend
Proof of Concept
Proof of Concept
Previous#47008 [SC-High] any users with expired loan(not settled) can take theft of lenders collateral when the collateral price increaseNext#47100 [SC-Insight] some checks should be added even if the operator checks each input parameters
Was this helpful?