The VaultDepositController:withdraw function lacks adequate access control, which allows anyone to call the function and withdraw funds from the vaults. This absence of a proper access control mechanism creates a significant risk of unauthorized withdrawals, compromising the integrity of the funds stored in the vaults.
The withdraw function in the VaultDepositController contract is marked as external and lacks a proper access control mechanism that limits its execution to authorized entities. In its current state, any external account can invoke this function to withdraw funds from the vaults, which poses a significant risk to the security of the funds managed by the contract.
The expected behavior for the withdraw function is that it should only be callable by a designated contract, such as the StakingPool, which acts as the central authority for managing withdrawals. This approach is consistent with the access control mechanism implemented in the StakingPool and PriorityPool contracts, where functions are restricted using modifiers like onlyStakingPool.
Currently, the withdraw function does not have any access control implemented, which means any external account can call this function and potentially withdraw funds from the vaults without restriction.
An attacker discovers that the withdraw function is not restricted by any access control mechanism.
The attacker calls the withdraw function with an amount and data of their choice.
The function executes the withdrawal logic and transfers funds to the attacker's address, leading to the loss of funds from the vaults.
An attacker or unauthorized user could call the withdraw function to withdraw any amount from the vaults, resulting in a direct financial loss. The uncontrolled withdrawal of funds could lead to the depletion of the vault’s liquidity, preventing legitimate users or contracts from performing their operations.
Manual Review
Add a new modifier to the VaultDepositController contract that ensures only the StakingPool contract can call the withdraw function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.