Core Contracts

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

Potential Over-Approval Risk as RToken Increases in Value Over Time

01. Relevant GitHub Line

02. Summary

In the RToken contract, the value of each scaled amount grows over time due to the interest accrual mechanism. If a user grants an approval at an early stage, the approved value effectively becomes larger as the index increases. This can cause unintentional over-approval of assets and potentially expose users to losses they did not anticipate.

03. Vulnerability Details

The RToken’s balanceOf function multiplies super.balanceOf(account) by ILendingPool(_reservePool).getNormalizedIncome(), causing the balance to scale upward over time. Consequently, an approve set at the beginning (when the scaled value is smaller) becomes more valuable later as the index increases.

/**
* @notice Returns the scaled balance of the user
* @param account The address of the user
* @return The user's balance (scaled by the liquidity index)
*/
function balanceOf(address account) public view override(ERC20, IERC20) returns (uint256) {
uint256 scaledBalance = super.balanceOf(account);
return scaledBalance.rayMul(ILendingPool(_reservePool).getNormalizedIncome());
}

Therefore, if someone approves a certain amount early on, the actual value of that approval grows as the market evolves.

An additional (but separate) issue is that the current approve function does not convert the requested amount into a scaled amount, potentially causing users to approve more assets than intended. This separate issue is not covered in this report.

04. Impact

  • Users might unknowingly grant approvals that increase in real value over time, leading to unanticipated asset expenditures.

  • This discrepancy can create a risk of losing more funds than originally intended if a third party utilizes the approved tokens later, after their value has increased.

05. Tools Used

Manual Code Review and Foundry

06. Recommended Mitigation

  • Implement time-limited approvals, ensuring the approval amount is valid only for a specified period. This prevents indefinite growth of the approval’s real value over time.

  • Store approval amounts in terms of the underlying token’s value rather than scaled amounts. Then, when transferFrom is called, dynamically scale the transfer amount using the current liquidity index. This approach ensures the approval amount always reflects its actual value.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!