Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Invalid

Wrong Repay Amount Cap

Summary

In LendingPool.sol the repayment amount is incorrectly capped at userScaledDebt instead of userDebt, leading to potential inaccuracies in the repayment process.

Vulnerability Details

The vulnerability occurs in the _repay function where the actualRepayAmount is calculated. The current implementation caps actualRepayAmount at userScaledDebt, which is the user's debt scaled by the reserve's usage index. However, the correct value to cap the repayment amount should be userDebt, which represents the actual debt the user owes. This discrepancy leads to incorrect repayment amounts being processed.

Impact

By capping the repayment amount at userScaledDebt instead of userDebt, the contract processes incorrect repayment amounts. This results in users either overpaying or underpaying their debt, leading to potential financial discrepancies and losses for the lending pool.

Tools Used

Manual Review

Recommendations

To mitigate this vulnerability, update the _repay function to cap the actualRepayAmount at userDebt instead of userScaledDebt. This ensures that the correct repayment amount is processed, preventing potential overpayment or underpayment issues.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

LendingPool::_repay caps actualRepayAmount at userScaledDebt instead of userDebt, preventing users from repaying full debt with interest in one transaction

That amount is not actually used.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.