Liquid Staking

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

function updateDeposits is liable to DOS attack

Summary

In the VaultControllerStrategy.sol contract, the function updateDeposits is vulnerable to Denial of Service (DoS) attacks, particularly due to potential high gas consumption when calculating and distributing fees. The function likely processes an array of fees (fees[]), and as this array grows large, the gas cost to calculate and distribute the fees in a single transaction can become excessive. This could lead to transaction failures or a DoS if the gas limit is exceeded.

Vulnerability Details

Prevents protocol from updating deposits

Impact

  • Denial of Service (DoS) via Gas Limit:
    If the fees[] array grows too large, the function could require more gas than is available in a single block, causing the transaction to fail repeatedly. This
    would prevent the function from successfully updating deposits and distributing fees, which could halt critical operations in the contract.

  • High Gas Costs:
    Even if the transaction does not fail, the gas costs could become prohibitively high for users, making it expensive to perform basic operations like
    deposit updates or fee distributions. This could deter users from interacting with the contract and degrade the overall user experience.

Recommendations

  • Limit the Size of the fees[] Array:
    Implement a maximum size for the fees[] array. If the array grows beyond a predefined threshold, split the processing across multiple transactions or
    time intervals. This will prevent a single call to updateDeposits from consuming excessive gas.

  • Use Off-Chain Calculations:
    For more gas-efficient fee processing, offload the fee calculation to an off-chain process. This involves calculating the fees off-chain and submitting the
    results on-chain for distribution. By moving the computationally intensive part off-chain, you significantly reduce gas costs for the on-chain operations.

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.