kaysoft - Loss of ETH when user deposits stEth or WETH but msg.value is not zero #39
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
kaysoft
Medium
Loss of ETH when user deposits stEth or WETH but msg.value is not zero
Summary
When a user tries to deposit
stEth
orWETH
token butmsg.value
is greater than zero the ETH will be lost to the DepositWrapper.sol contract.Vulnerability Detail
The deposit function accepts deposits of ETH, stETH, WETH and wstETh which are finally converted to wstETH. When a user tries to deposit any of
stETH
,WETH
andwstETh
, there is no check to ensure thatmsg.value
sent along with the transaction is zero. This could cause users to lose ETH to the DepositWrapper.sol smart contract when trying to deposit.Impact
Loss of ETH when user deposits stEth or WETH but msg.value is not zero
Code Snippet
https://github.com/sherlock-audit/2024-06-mellow/blob/main/mellow-lrt/src/utils/DepositWrapper.sol#L42C5-L75C6
Tool used
Manual Review
Recommendation
Consider validating that
msg.value == 0
when a user tries to deposit eitherstEth
orWETH
tokens this way:The text was updated successfully, but these errors were encountered: