Closed howlbot-integration[bot] closed 5 months ago
Yes, but we assumed the data sent is correct so this is extremely unlikely
koolexcrypto marked the issue as duplicate of #8
koolexcrypto marked the issue as satisfactory
koolexcrypto changed the severity to 3 (High Risk)
koolexcrypto changed the severity to QA (Quality Assurance)
koolexcrypto marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2024-05-loop/blob/0dc8467ccff27230e7c0530b619524cc8401e22a/src/PrelaunchPoints.sol#L439 https://github.com/code-423n4/2024-05-loop/blob/0dc8467ccff27230e7c0530b619524cc8401e22a/src/PrelaunchPoints.sol#L259 https://github.com/code-423n4/2024-05-loop/blob/0dc8467ccff27230e7c0530b619524cc8401e22a/src/PrelaunchPoints.sol#L497 https://github.com/code-423n4/2024-05-loop/blob/0dc8467ccff27230e7c0530b619524cc8401e22a/src/PrelaunchPoints.sol#L459
Vulnerability details
Impact
If the
_validateData
function receives a decoded recipient address ofaddress(0)
from_decodeUniswapV3Data
and does not revert, the contract will proceed with the swap, and the resultingETH
will be sent toaddress(0)
, effectively burning theETH
. This could lead to a loss of funds for users attempting to claim theirlpETH
.Proof of Concept
In the
_validateData
function, the recipient address is checked againstaddress(this)
andaddress(0)
:The
_decodeUniswapV3Data
function can potentially returnaddress(0)
as therecipient
:If
address(0)
is returned and not reverted, the swap will send ETH toaddress(0)
:The condition in
_validateData
does not revert whenrecipient
isaddress(0)
, which is an oversight. The intention is likely to ensure that the recipient is either the contract itself or not set (implicitlyaddress(0)
), but this logic allows for the possibility that ETH could be sent toaddress(0)
if the_swapCallData
is crafted to do so.Tools Used
Manual Review
Recommended Mitigation Steps
Modify the
_validateData
function to explicitly check that the recipient isaddress(this)
only in theif (_exchange == Exchange.UniswapV3)
branch and revert if not. This ensures that the contract does not allow ETH to be sent toaddress(0)
:This change will prevent the contract from proceeding with a swap that would result in sending ETH to
address(0)
, thereby safeguarding users' funds during the claim process.Assessed type
ETH-Transfer