Closed code423n4 closed 1 year ago
Alice can only burn her own lpTokens
. The call to burnLPTokensForEth
leads us to a call to burnLPForETH
which checks the balance of msg.sender and burns the sender's lpTokens.
dmvt marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2022-11-stakehouse/blob/5f853d055d7aa1bebe9e24fd0e863ef58c004339/contracts/liquid-staking/GiantSavETHVaultPool.sol#L137-L157 https://github.com/code-423n4/2022-11-stakehouse/blob/5f853d055d7aa1bebe9e24fd0e863ef58c004339/contracts/liquid-staking/GiantMevAndFeesPool.sol#L126-L138
Vulnerability details
Impact
Node runners, while competing for crowdsourced funds, can withdraw the funds that were deposited via Giant pools from competitor's vaults, and send them to their vaults. This will also lock node runners out of deploying a validator when the full stake amount is collected.
Proof of Concept
The Giant pools implement the
bringUnusedETHBackIntoGiantPool
function that allows anyone to withdraw funds from a vault and send them back to the Giant pool:GiantSavETHVaultPool.sol#L137-L157:
While this mechanism allows stakers to withdraw funds from stale vaults, it can be also abused by node runners to remove funds from the vaults of their competitors and lock their competitors out of deploying a validator.
Example Exploit Scenario
GiantSavETHVaultPool
pool and 4 ETH to theGiantMevAndFeesPool
pool (these pools are global and used by all LSD managers).batchDepositETHForStaking
functions of the Giant pools to deposit the users' funds into the vaults of his LSD manager.stake
function of his LSD manager (LiquidStakingManager.sol#L524) to register a validator, Alice calls thebringUnusedETHBackIntoGiantPool
functions of the Giant pools and removes the users' funds from the vaults of the Bob's LSD manager.batchDepositETHForStaking
to withdraw funds from the Giant pools to her vault and callsstake
to deploy a validator.Tools Used
Manual Review
Recommended Mitigation Steps
Consider adding a function that allows node runners withdrawing funds from Giant pools and registering a validator in one transaction.