Liquid Staking

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

Lack of validation of Input Parameters of _depositVaults

Summary

In the VaultControllerStrategy.sol contract, the _depositToVaults function lacks validation for its input parameters, specifically _startIndex, _toDeposit, _minDeposits, and _maxDeposits. Without proper validation, incorrect or malicious inputs could lead to unexpected behavior, such as incorrect vault access, improper deposits, or potential contract malfunctions.

Impact

  • Invalid Vault Access:
    Out-of-Bounds Errors: If _startIndex is greater than or equal to the number of vaults in the system (vaults.length), the function might attempt to access a non-existent vault, leading to a potential error or failure in the contract. This could result in transaction reverts or worse, depending on how the function handles this condition.

  • Unintentional Zero Deposits:
    Zero or Negative Deposit Amounts: Without validation on _toDeposit, the function could potentially process deposits with a value of zero or even less, which could be either an inefficient transaction or a way to exploit the contract, depending on how negative values are handled.

Recommendations

  • Input Validation for Vault Index and deposits:
    Validate _startIndex: Ensure that _startIndex is a valid index within the vaults array by checking it against the total length of the vaults.

require(_startIndex < vaults.length, "Invalid start index");
require(_minDeposits <= _maxDeposits, "Minimum deposits must be less than or equal to maximum deposits");
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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