Liquid Staking

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

The `FundFlowController` assumes that the `claimPeriod` will remain constant.

Summary

The FundFlowController constructor retrieves the current claimPeriod value utilized in the linked StakingPoolBase.sol contract. However, it is important to note that the claimPeriod can be updated, which will impact all operations of the FundFlowController. Further details will be provided in the subsequent section.

Vulnerability Details

Upon reviewing the FundFlowController code, it is observed that the claimPeriod is set within the initialize function, and there is no setter function available to update the claimPeriod if it changes in the Chainlink staking contract.

2024-09-stakelink/contracts/linkStaking/FundFlowController.sol:62
62: claimPeriod = _claimPeriod; // @audit : add setter function for claimPeroid
63: numVaultGroups = _numVaultGroups;

Now, let us examine the Chainlink Staking Pool Base, which includes a function designed to update the claimPeriod.

function setClaimPeriod(uint256 claimPeriod)
external
onlyRole(DEFAULT_ADMIN_ROLE)
whenBeforeClosing
{
_setClaimPeriod(claimPeriod);
}

Limit check to which the claim period can be updated

function _setClaimPeriod(uint256 claimPeriod) private {
if (claimPeriod < i_minClaimPeriod || claimPeriod > i_maxClaimPeriod) {
revert InvalidClaimPeriod();
}

The current claimPeriod is set to 7 days, but it can be adjusted to any value ranging from 1 day to 30 days.

The following functions in the FundFlowController and VaultDepositController contracts will be affected:

  1. claimPeriodActive

  2. updateVaultGroups

  3. VaultControllerStrategy:withdraw

  4. VaultControllerStrategy::getMinDeposits()

Impact

  1. If the claimPeriod is adjusted, the protocol erroneously assumes it can unbind the funds from Chainlink staking, while in reality, it cannot.

  2. The claimPeriodActive function will yield an incorrect response.

  3. The withdraw function is vulnerable to a Denial of Service (DoS) attack, as the protocol assumes it can withdraw funds when it actually cannot.

Tools Used

Manual Review

Recommendations

Instead of storing the claimPeriod within the FundFlowController contract, it is recommended to utilize the StakingPoolBase::getUnbondingParams, which will consistently return the current claimPeriod.

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

Or set a setter function for claimPeriod which will update the claimPeriod.

Updates

Lead Judging Commences

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

Appeal created

0xaman Submitter
7 months ago
inallhonesty Lead Judge
7 months ago
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.