Liquid Staking

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

The `FundFlowController` presumes that the `unbondingPeriod` will not alter at linkStaking

Summary

The FundFlowController constructor recieves the current unbonding period value used in the chain link Stakie.sol contract, but the problem here is that the unbonding period can also be updated; this will affect all the operations of 'FundFlowController.` More details are given in the subsequent section.ngPoolBas

Vulnerability Details

Upon reviewing the FundFlowController code, we found that the unbonding period is set within the initialization process. However, there is no setter function available to update the unbonding period if it changes in the chain link staking contract.

2024-09-stakelink/contracts/linkStaking/FundFlowController.sol:61
61: unbondingPeriod = _unbondingPeriod; // @audit : add setter function for unbouningPeroid

Now, let's take a look at the chain link staking pool base, where they have implemented a function to update the unbonding period

function setUnbondingPeriod(uint256 newUnbondingPeriod)
external
onlyRole(DEFAULT_ADMIN_ROLE)
whenBeforeClosing
{
_setUnbondingPeriod(newUnbondingPeriod);
}

A limit check is in place to control the extent to which the claim period can be updated.

function _setUnbondingPeriod(uint256 unbondingPeriod) internal {
if (unbondingPeriod == 0 || unbondingPeriod > i_maxUnbondingPeriod) {
revert InvalidUnbondingPeriod();
}

current claim Period : 728 days , but it can be changed to any value between >0 to 60 days.

The following functions of FundFlowController and VaultDepositController contract functions will be affected:

  1. claimPeriodActive

  2. updateVaultGroups

  3. VaultControllerStrategy:withdraw

  4. VaultControllerStrategy::getMinDeposits()

Impact

  1. Since the unbonding period can be increased or decreased, it may result in a DoS for unbonding operations.

  2. The claimPeriodActive function may return incorrect responses.

  3. The withdraw function could face a DoS issue, as the protocol might assume it can withdraw funds when, in reality, it cannot.

Tools Used

Manual Review

Recommendations

Instead of storing the unbondingPeriod within the FundFlowController contract, use the StakingPoolBase::getUnbondingParams function, which will always return the current unbondingPeriod.

function getUnbondingParams() external view returns (uint256, uint256) {
return (s_pool.configs.unbondingPeriod, s_pool.configs.claimPeriod);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

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

setters for various parameters of Chainlink

Support

FAQs

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