Liquid Staking

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

Unhadled decoding error in performUpkeep function

Summary

Unhadled decoding error in performUpkeep function.

Vulnerability Details

In the performUpkeep function, there's an attempt to decode the _performData parameter using abi.decode(_performData, (bool[])). If this decoding fails due to improperly formatted input data, the function will revert without providing a clear error message or allowing for graceful error handling.

*/
function performUpkeep(bytes calldata _performData) external {
bool[] memory splittersToCall = abi.decode(_performData, (bool[]));
bool splitterCalled;
for (uint256 i = 0; i < splittersToCall.length; ++i) {
if (splittersToCall[i] == true) {
splitters[accounts[i]].performUpkeep("");
splitterCalled = true;
}
}
if (splitterCalled == false) {
revert InvalidPerformData();
}
}

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/lstRewardsSplitter/LSTRewardsSplitterController.sol#L93C3-L107C6

Impact

The function will revert without providing a clear error.

Tools Used

Manual review

Recommendations

Handle decoding error.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 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.