Open code423n4 opened 1 year ago
dmvt marked the issue as primary issue
vince0656 marked the issue as sponsor disputed
Node runners should index the chain when the knot is removed from the LSD network and update their fee recipient
I'm going to leave this in place but as a medium.
dmvt changed the severity to 2 (Med Risk)
dmvt marked the issue as satisfactory
dmvt marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/LiquidStakingManager.sol#L218-L220 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L154-L157 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L597-L607 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L610-L627 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L174-L197
Vulnerability details
Impact
When the
deRegisterKnotFromSyndicate
function is called by the DAO, the_deRegisterKnot
function is eventually called to executenumberOfRegisteredKnots -= 1
. It is possible thatnumberOfRegisteredKnots
is reduced to 0. During the period when the syndicate has no registered knots, the EIP1559 rewards that are received by the syndicate remain in the syndicate since functions likeupdateAccruedETHPerShares
do not include any logics for handling such rewards received by the syndicate. Later, when a new knot is registered and mints the derivatives, the node runner can call theclaimRewardsAsNodeRunner
function to receive half ot these rewards received by the syndicate during the period when it has no registered knots. Yet, because such rewards are received by the syndicate before the new knot mints the derivatives, the node runner should not be entitled to these rewards. Moreover, due to the issue mentioned in my other finding titled "Staking Funds vault's LP holder cannot claim EIP1559 rewards after derivatives are minted for a new BLS public key that is not the first BLS public key registered for syndicate", calling theStakingFundsVault.claimRewards
function by the Staking Funds vault's LP holder reverts so the other half of such rewards is locked in the syndicate. Even if calling theStakingFundsVault.claimRewards
function by the Staking Funds vault's LP holder does not revert, the Staking Funds vault's LP holder does not deserve the other half of such rewards because these rewards are received by the syndicate before the new knot mints the derivatives. Because these EIP1559 rewards received by the syndicate during the period when it has no registered knots can be unfairly sent to the node runner or remain locked in the syndicate, such rewards are lost.https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/LiquidStakingManager.sol#L218-L220
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L154-L157
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L597-L607
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L610-L627
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L174-L197
Proof of Concept
Please add the following code in
test\foundry\LiquidStakingManager.t.sol
.Import
stdError
as follows.Add the following test. This test will pass to demonstrate the described scenario.
Tools Used
VSCode
Recommended Mitigation Steps
The
else
block of theupdateAccruedETHPerShares
function (https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/syndicate/Syndicate.sol#L194-L196) can be updated to include logics that handle the EIP1559 rewards received by the syndicate during the period when it has no registered knots.