Skip to content

CRITICAL: Missing Collateral LTV Ratio Check β€” Borrower Sets Own CollateralΒ #1

Description

@hebridean-tech

🚨 Critical Vulnerability Found

During a security review of your lending protocol, I found a critical vulnerability that could allow borrowers to extract loans without adequate collateral.


Finding: Missing LTV Ratio Enforcement

Severity: CRITICAL
Files: LendSmartLoan.sol β€” requestLoan(), depositCollateral()

The requestLoan() function accepts any collateral amount from the borrower without enforcing a minimum Loan-to-Value (LTV) ratio.

function requestLoan(uint256 _loanAmount, uint256 _collateralAmount) external {
    // MISSING: LTV ratio check
    // Should verify: _collateralAmount >= _loanAmount * minCollateralRatio
    ...
}

The depositCollateral() function similarly only checks balance and allowance:

function depositCollateral(uint256 collateralAmount) external {
    require(ERC20(collateralToken).balanceOf(msg.sender) >= collateralAmount);
    require(ERC20(collateralToken).allowance(msg.sender, address(this)) >= collateralAmount);
    // MISSING: No minimum ratio check
    ...
}

Impact: A borrower can request a $1,000,000 loan with $0.01 in collateral. The system would approve the loan because no minimum collateral-to-loan ratio is enforced. This would result in unlimited lending with zero real backing β€” effectively a minting exploit.

Exploitation:

  1. Attacker calls requestLoan(1_000_000, 1) β€” $1M loan with 1 wei collateral
  2. Protocol approves the loan
  3. Attacker walks away with $1M

Recommendations

  1. Add minCollateralRatio as a protocol parameter (e.g., 150% = 1.5x overcollateralization)
  2. Enforce in requestLoan(): require(_collateralAmount * 100 >= _loanAmount * minCollateralRatio)
  3. Add dynamic LTV check: Verify health factor before loan disbursement
  4. Add margin call / liquidation logic: If LTV drops below threshold, trigger liquidation
  5. Cap single-borrower exposure: Maximum loan per borrower

πŸ’Ό Free Fix Guidance

If you would like help implementing these fixes, I am an independent security researcher specializing in DeFi lending protocols. I would be happy to:

  1. Patch this vulnerability for free (as a responsible disclosure)
  2. Perform a full protocol audit ($500) covering all 4 contracts (Loan, Collateral, Borrower, LoanManager)

Your protocol has interesting ML-based credit scoring β€” the smart contract layer needs equivalent rigor.


Responsible disclosure. Please confirm receipt. Happy to discuss fix implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions