Can verify with an external validator that is not registered in the Rio system. Prevent other operators from verifying
Summary
It is possible to call OperatorRegistry.verifyWithdrawalCredentials with validators not registered in the system or not rebalanced. This can disrupt the unverifiedValidatorETHBalance variable and make it impossible for other operators to call OperatorRegistry.verifyWithdrawalCredentials.
Vulnerability Detail
Operators can stake ETH directly by calling ETHPOSDeposit.deposit without going through the Rio system. Even if staked directly, it has no effect on EigenLayer (there is no change in storage variables in the stake function).
After directly staking, if you call OperatorRegistry.verifyWithdrawalCredentials, you can verify the validator who does not registered, or registereb but not deposited by rebalance. The unverifiedValidatorETHBalance variable increases in rebalance and decreases in OperatorRegistry.verifyWithdrawalCredentials, so unverifiedValidatorETHBalance becomes smaller than normal situation.
As the result, if operator tries to verify the validator, it can be reverted due to underflow of unverifiedValidatorETHBalance
At OperatorRegistry.verifyWithdrawalCredentials, check whether the validator to be verified is a validator registered in the system(check pubkey) and whether it is in deposit state (by rebalance).
klaus
medium
Can verify with an external validator that is not registered in the Rio system. Prevent other operators from verifying
Summary
It is possible to call
OperatorRegistry.verifyWithdrawalCredentials
with validators not registered in the system or not rebalanced. This can disrupt theunverifiedValidatorETHBalance
variable and make it impossible for other operators to callOperatorRegistry.verifyWithdrawalCredentials
.Vulnerability Detail
Operators can stake ETH directly by calling
ETHPOSDeposit.deposit
without going through the Rio system. Even if staked directly, it has no effect on EigenLayer (there is no change in storage variables in the stake function).After directly staking, if you call
OperatorRegistry.verifyWithdrawalCredentials
, you can verify the validator who does not registered, or registereb but not deposited byrebalance
. TheunverifiedValidatorETHBalance
variable increases inrebalance
and decreases inOperatorRegistry.verifyWithdrawalCredentials
, sounverifiedValidatorETHBalance
becomes smaller than normal situation.As the result, if operator tries to verify the validator, it can be reverted due to underflow of
unverifiedValidatorETHBalance
This is PoC. Add it to the RioLRTDepositPool.t.sol file and run it. Add an import statement at the top of the code.
Impact
You can verify with an external validator not registered in the Rio system(not
addValidatorDetails
called). Can prevent other operators from verifyingCode Snippet
https://github.com/sherlock-audit/2024-02-rio-network-core-protocol/blob/4f01e065c1ed346875cf5b05d2b43e0bcdb4c849/rio-sherlock-audit/contracts/restaking/RioLRTOperatorRegistry.sol#L250
Tool used
Manual Review
Recommendation
At
OperatorRegistry.verifyWithdrawalCredentials
, check whether the validator to be verified is a validator registered in the system(check pubkey) and whether it is in deposit state (by rebalance).Duplicate of #235