Liquid Staking

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

Insufficient Input Validation in updateFee() Function

Summary

This report highlights insufficient input validation in the updateFee function of the LSTRewardsSplitter contract. The absence of checks for the _receiver address and the _index can lead to unintended behavior, such as invalid fee assignments or the accidental removal of fees. Implementing proper validation measures is essential for maintaining the security and reliability of the fee management system.

Vulnerability Details

The updateFee function in the StakingPool contract lacks sufficient input validation for the _receiver address and the _index value. This can lead to the introduction of invalid parameters and unintended consequences for fee management.

Details

Impact

  • Invalid Address: If the _receiver address is invalid (e.g., zero address), it could lead to fees being sent to an unintended or malicious address.

  • index Validation: The function allows for a _index value of zero without prior validation, which can lead to unintended behaviour.

Tools Used

Recommendations

Validate _receiver Address: Ensure that the _receiver address is not the zero address to prevent fees being directed to an invalid recipient.

Validate _index: Add a check to ensure that _index is greater than zero when updating a fee.

function updateFee(
uint256 _index,
address _receiver,
uint256 _feeBasisPoints
) external onlyOwner {
require(_index > 0, "index must be greater than zero");
require(_index < fees.length, "Fee does not exist");
require(_receiver != address(0), "Invalid receiver address");
if (_feeBasisPoints == 0) {
fees[_index] = fees[fees.length - 1];
fees.pop();
} else {
fees[_index].receiver = _receiver;
fees[_index].basisPoints = _feeBasisPoints;
}
if (_totalFeesBasisPoints() > 10000) revert FeesExceedLimit();
}
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.