Open code423n4 opened 1 year ago
dmvt marked the issue as primary issue
As with #308, I recommend that the sponsor review all of the duplicates of this issue.
vince0656 marked the issue as sponsor confirmed
dmvt marked the issue as selected for report
dmvt marked the issue as satisfactory
I believe lack of existence check on passed address is very deep into QA/L territory, as has been standardized in the org - https://github.com/code-423n4/org/issues/53 Requires a massive user mistake, imo rewarding these kinds of findings as M dilutes the pool and does injustice to proper Ms. @GalloDaSballo
See my response in the post-judging qa discussion.
Lines of code
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
Vulnerability details
Impact
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 returntrue
. 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.Tools Used
Manual audit.
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.