smartWallet address is not guaranteed correct. ETH may be lost
The vault's ETH withdrawal function for staking does not check that the supplied smart wallet address actually exists, so a mistyped or wrong address still receives the transfer and the ETH becomes permanently locked. An attacker or careless manager could therefore cause loss of funds by passing a non-existent address.
Submitted by gz627, also found by datapunk
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/SavETHVault.sol#L206-L207 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/SavETHVault.sol#L209
Liquid staking manager call function withdrawETHForStaking(address _smartWallet, uint256 _amount) to withdraw ETH for staking. It’s manager’s responsibility to set the correct _smartWallet address. However, there is no way to guarantee this. If a typo (or any other reasons) leads to a non-zero non-existent _smartWallet address, this function won’t be able to detect the problem, and the ETH transfer statement will always return true. This will result in the ETH permanently locked to a non-existent account.
Proof of Concept
Liquid staking manager call function withdrawETHForStaking(address _smartWallet, uint256 _amount) with a non-zero non-existent _smartWallet address and some _amount of ETH. Function call will succeed but the ETH will be locked to the non-existent _smartWallet address.
Recommended Mitigation Steps
The problem can be solved if we can verify the _smartWallet is a valid existent smartWallet before ETH transfer. The easiest solution is to verify the smartWallet has a valid owner since the smart wallet we are using is ownable. So, just add the checking owner code before ETH transfer.
vince0656 (Stakehouse) confirmed
As with
#308, I recommend that the sponsor review all of the duplicates of this issue.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the withdrawal function trusts the caller-supplied smart wallet address without verifying that a contract or owner exists there before transferring ETH.
Impact
ETH sent to a non-existent smart wallet address is permanently locked and cannot be recovered.
What the attacker needed
Manager supplies a wrong address; address is non-zero and non-existent
The fix
The contract should verify the smart wallet is valid, for example by checking it has an owner, before transferring ETH.
How it was found
- The liquid staking manager calls the ETH withdrawal function for staking.
- The manager supplies a non-zero address that does not exist as a smart wallet.
- The call succeeds and the ETH is sent to that address, where it is locked.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract can send ether to any address, even one nobody controls. If the address was typed wrongly, the money arrives there but no one can ever spend it. This report says the contract should check the destination is a real wallet before sending.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.