Liquid Staking

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

Lack of Owner Control Over Resetting Rewards Receiver

Summary

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/linkStaking/OperatorVault.sol#L261
The setRewardsReceiver function restricts the ability to modify the rewards receiver to the current rewards receiver itself, leaving the contract owner unable to intervene or reset the rewards receiver after it has been set. This poses a control issue for the owner, particularly if the rewards receiver becomes unreachable or compromised, as the owner cannot directly modify the rewardsReceiver.

Vulnerability Details

In the setRewardsReceiver function, the logic imposes strict access control that only allows the current rewardsReceiver to modify its own address after it has been set. The owner is permitted to set the rewardsReceiver only when it is initially set to address(0).

if (rewardsReceiver != address(0) && msg.sender != rewardsReceiver)
revert OnlyRewardsReceiver();
if (rewardsReceiver == address(0) && msg.sender != owner()) revert OnlyRewardsReceiver();

After the rewardsReceiver has been set, the owner loses the ability to reset or modify the rewards receiver. This can cause operational issues if the rewards receiver is compromised, loses access, or is otherwise unable to perform its functions.

Impact

The contract owner is unable to change or reset the rewardsReceiver once it has been set, even in cases where such action might be necessary, such as the receiver becoming unresponsive or compromised.

Tools Usedhttps://codehawks.cyfrin.io/c/2024-09-stakelink?new-submission=true

Manual Review

Recommendations

Allow the owner to always have the ability to reset the rewardsReceiver, regardless of whether a receiver is already set. This would provide a failsafe mechanism for recovering control of the vault's rewards in case of emergency.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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