Core Contracts

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

Wrong Repay Amount

Summary

In LendingPool.sol the repayment process should use actualRepayAmount instead of amount to ensure accurate debt repayment.

Vulnerability Details

The vulnerability occurs in the _repay function where the repayment amount is processed. The current implementation uses amount directly, which may not accurately reflect the user's actual debt after considering the reserve's usage index and the user's scaled debt. actualRepayAmount is the correctly calculated amount that should be repaid, taking into account the user's actual debt and any necessary scaling. Using amount directly can lead to incorrect repayment amounts being processed.

Impact

By using amount instead of actualRepayAmount, the contract may process incorrect repayment amounts. This can result 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 use actualRepayAmount instead of amount. 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
Validated
Assigned finding tags:

LendingPool::_repay compares scaled userScaledDebt with unscaled amount, creating unused actualRepayAmount; calculation is bypassed when burn is called with original amount

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

LendingPool::_repay compares scaled userScaledDebt with unscaled amount, creating unused actualRepayAmount; calculation is bypassed when burn is called with original amount

Support

FAQs

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