-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users can claim more lpETH than locked ETH in case of someone sends ETH to the contract directly #18
Comments
koolexcrypto marked the issue as duplicate of #6 |
koolexcrypto marked the issue as partial-50 |
koolexcrypto marked the issue as not a duplicate |
koolexcrypto marked the issue as primary issue |
koolexcrypto marked the issue as satisfactory |
koolexcrypto changed the severity to 3 (High Risk) |
koolexcrypto changed the severity to 2 (Med Risk) |
koolexcrypto changed the severity to 3 (High Risk) |
koolexcrypto marked the issue as duplicate of #33 |
Lines of code
https://github.com/code-423n4/2024-05-loop/blob/40167e469edde09969643b6808c57e25d1b9c203/src/PrelaunchPoints.sol#L179-L182
https://github.com/code-423n4/2024-05-loop/blob/40167e469edde09969643b6808c57e25d1b9c203/src/PrelaunchPoints.sol#L321-L322
Vulnerability details
Impact
The contract is designed to receive ETH so that users can use the function
lockETH()
to get lpETH (1 to 1 conversion). User deposits are stored in the state variable
totalSupply
. While converting all user deposited ETH to lpETH via a privileged functionconvertAllETH()
, the ETH balance of the current contract is used instead of the state variabletotalSupply
. In case that some users mistakenly sent ETH directly to the contract the 1 to 1 conversion ratio of ETH to lpETH will be broken leading to users getting more lpETH than they were supposed to.Proof of Concept
totalBalance
variable in the functionconvertAllETH()
will be 1010 resulting in minting of 1010 lpETH.totalLpETH
state variable will be also 1010.claimedAmount = userStake.mulDiv(totalLpETH, totalSupply);
In this situation, all users will get 1.01 more lpETH that the ETH they staked. It will be more if the amount of ETH that was mistakenly sent is higher.
Tools Used
Manual review.
Recommended Mitigation Steps
Use state variable
totalSupply
in the functionconvertAllETH
instead of "address(this).balance" to calculate the amount to be deposited to lpETH contract.Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: