Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: high
Invalid

VaultDepositController::withdraw() and VaultDepositController::deposit() is callable by anybody

The VaultDepositController::withdraw function and the VaultDepositController::deposit functions are meant to be called by the VaultControllerStrategy using delegatecall from functions callable only by the stakingPool. However, neither of these functions check if the msg.sender == stakingPool, which allows anybody to bypass the onlyOwner guard in the StakingPool::strategyDeposit and StakingPool::strategyWithdraw functions and allows them to manually deposit/withdraw asset tokens into/from from a vault.

File: File: contracts/linkStaking/base/VaultControllerStrategy.sol#L81-L87
/**
* @notice Deposits tokens from the staking pool into vaults
* @dev called by VaultControllerStrategy using delegatecall
* @param _amount amount to deposit
* @param _data encoded vault deposit order
*/
function deposit(uint256 _amount, bytes calldata _data) external {
File: File: contracts/linkStaking/base/VaultControllerStrategy.sol#L105-L111
/**
* @notice Withdraws tokens from vaults and sends them to staking pool
* @dev called by VaultControllerStrategy using delegatecall
* @param _amount amount to withdraw
* @param _data encoded vault withdrawal order
*/
function withdraw(uint256 _amount, bytes calldata _data) external {

As a result, anybody to act out as a trusted entity, the stakingPool, withdraw asset tokens from vaults for themselves on behalf of the stakingPool or making the protocol behaves unpredictably by manually depositing asset tokens into vault.

Recommendation

Add the onlyStakingPool modifier to the VaultDepositController::withdraw and VaultDepositController::deposit functions.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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