Liquid Staking

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

Lack of Access Control in `LSTRewardsSplitter::performUpkeep` Allows an Attacker to Cause Fee Receiver to Lose Rewards

Summary

The LSTRewardsSplitter::performUpkeep function lacks proper access control, allowing any user to call the function. This opens up a vulnerability where an attacker can grief a fee receiver by frontrunning the owner's addFee transaction, causing the fee receiver to miss out on rewards. The function is intended for use by specific users, but since anyone can call it, the attacker can manipulate the reward distribution process to the detriment of the receiver and against the desires of the contract owner.

Vulnerability Details

The performUpkeep function in the LSTRewardsSplitter contract is publicly accessible, meaning any external user can call it. Here’s the function:

function performUpkeep(bytes calldata) external {
int256 newRewards = int256(lst.balanceOf(address(this))) - int256(principalDeposits);
if (newRewards < 0) {
principalDeposits -= uint256(-1 * newRewards);
} else if (uint256(newRewards) < controller.rewardThreshold()) {
revert InsufficientRewards();
} else {
_splitRewards(uint256(newRewards));
}
}

If an attacker frontruns an addFee transaction by the owner, they can call performUpkeep just before the owner adds a new fee receiver via addFee:

function addFee(address _receiver, uint256 _feeBasisPoints) external onlyOwner {
fees.push(Fee(_receiver, _feeBasisPoints));
if (_totalFeesBasisPoints() > 10000) revert FeesExceedLimit();
}

By calling performUpkeep before the owner can add a new fee, the attacker can split the rewards before the new fee receiver is included. As a result, the new fee receiver misses out on rewards for that upkeep cycle, contrary to the intentions of the contract owner.

Impact

An attacker can manipulate the reward distribution process by frontrunning the owner's addFee transaction, causing the new fee receiver to miss out on rewards. This undermines the fairness of the reward distribution process and can lead to financial losses for the fee receiver.

Tools Used

Manual

Recommendations

Add Access Control to performUpkeep: Restrict the ability to call performUpkeep to only authorized users, such as the contract owner or a designated keeper. This will prevent unauthorized users from interfering with the reward distribution process.

Updates

Lead Judging Commences

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

Support

FAQs

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