Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: medium
Valid

Non-Grouped Vaults with Deposits Cannot Be Removed Due to Unstake Failure

Summary

When removing vaults from a strategy in StakeLink, the OperatorVault::exitVault function fails to unstake the vault’s deposited tokens if the vault is not part of a group. This issue arises because the function relies on conditions that are not met for non-grouped vaults, making it impossible to call unstakeRemovedPrincipal. As a result, non-grouped vaults remain stuck, affecting the protocol’s operation and accounting.

Vulnerability Details

In StakeLink, when vaults are removed from a strategy, their OperatorVault::exitVault function is called to withdraw their staked tokens from the Chainlink staking contract. However, the function fails when it attempts to call stakeController::unstakeRemovedPrincipal(), as shown in the following code:

function unstakeRemovedPrincipal() external {
if (!_canUnstake(s_stakers[msg.sender])) {
revert StakerNotInClaimPeriod(msg.sender);
}
uint256 withdrawableAmount = s_operators[msg.sender].removedPrincipal;
if (withdrawableAmount == 0) {
revert UnstakeExceedsPrincipal();
}
delete s_operators[msg.sender].removedPrincipal;
i_LINK.transfer(msg.sender, withdrawableAmount);
emit Unstaked(msg.sender, withdrawableAmount, 0, s_pool.state.totalPrincipal);
}

The key issue lies in the preconditions for calling unstakeRemovedPrincipal. Specifically, the staker must be in the claim period or the pool must be closed or paused. This creates a problem for non-grouped vaults because StakeLink does not provide a way to enter the claim period for these vaults. The only time the unbond() function is called in StakeLink is within VaultControllerStrategy::updateVaultGroups, and it is only executed for vaults that are part of a group. As a result, non-grouped vaults can never satisfy the unstaking preconditions.

Impact

This issue prevents StakeLink from removing non-grouped vaults, making the protocol less manageable. Each stuck vault leads to undesirable changes in the protocol's accounting and affects the overall operation by locking staked tokens that cannot be removed.

Tools Used

Manual

Recommendations

Update the protocol to allow non-grouped vaults to enter the claim period and call unbond() when they are removed. This will ensure that unstakeRemovedPrincipal can be executed successfully for all vaults, whether grouped or not, allowing for proper removal and management of vaults in the system.

Updates

Lead Judging Commences

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

Non-Grouped Vaults cannot be exited because there is no means to unbond them

Support

FAQs

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