Core Contracts

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

Protocol vault withdrawal logic is incorrect

Summary

A wrong parameter is used in _withdrawFromVault() which will cause assets to be transferred incorrectly or reverted as the vault owner parameter is set to msg.sender instead of address(this).

Root Cause

In LendingPool.sol and ReserveLibrary.sol, the vault withdrawal function passes incorrect owner parameter which conflicts with the protocol's rebalancing design.

The problematic code:

function _withdrawFromVault(uint256 amount) internal {
-> curveVault.withdraw(amount, address(this), msg.sender, 0, new address[](0));
totalVaultDeposits -= amount;
}

Attack Path

  1. User tries to withdraw assets through lending pool

  2. _withdrawFromVault() is called with wrong owner parameter (msg.sender)

  3. Transaction reverts or assets are transferred incorrectly since vault shares are owned by the lending pool contract

Impact

The protocol will experience failed withdrawals or incorrect asset transfers, disrupting core functionality. This affects all users trying to withdraw assets from the vault.

Mitigation

Update the _withdrawFromVault() function to use the correct owner parameter:

/**
* @notice Internal function to withdraw liquidity from the Curve vault
* @param amount The amount to withdraw
*/
function _withdrawFromVault(uint256 amount) internal {
- curveVault.withdraw(amount, address(this), msg.sender, 0, new address[](0));
+ curveVault.withdraw(amount, address(this), address(this), 0, new address[](0));
totalVaultDeposits -= amount;
}
Updates

Lead Judging Commences

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

LendingPool::_withdrawFromVault incorrectly uses msg.sender instead of address(this) as the owner parameter, causing vault withdrawals to fail

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

LendingPool::_withdrawFromVault incorrectly uses msg.sender instead of address(this) as the owner parameter, causing vault withdrawals to fail

Support

FAQs

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

Give us feedback!