-
Notifications
You must be signed in to change notification settings - Fork 11
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
Depositor may be grief attacked and no rsETH will be minted #275
Comments
raymondfam marked the issue as sufficient quality report |
raymondfam marked the issue as duplicate of #42 |
fatherGoose1 marked the issue as not a duplicate |
Doesn't describe the standard donation attack. Instead highlights the issue with using the deposited funds in the share calculation, sharing impact with #62. |
fatherGoose1 marked the issue as duplicate of #62 |
fatherGoose1 marked the issue as satisfactory |
fatherGoose1 changed the severity to 2 (Med Risk) |
fatherGoose1 changed the severity to 3 (High Risk) |
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L136-L141
Vulnerability details
Impact
Depositor may be grief attacked and no
rsETH
will be minted.Proof of Concept
Depositor can mint
rsETH
by depositing asset through depositAsset(...) function.Asset will be transferred from depositor to the protocol:
Then
rsETH
will be minted through _mintRsETH(...) function:The amount of
rsETH
to be minted is calculated is determined byrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice()
, here lrtOracle.getRSETHPrice() returns thersETH
price:As we can see from above, the
rsETH
price is determined by the asset owned by the protocol and the total supply ofrsETH
. However, as the asset will be transferred to protocol before minting, the depositor may not receive a correct amount ofrsETH
, and even worse, depositor can be grief attacked and receive norsETH
at all.Imagine the following scenario:
rsETH
by depositing 1 etherstETH
(price is 1e18);stETH
;rsETH
will be minted to Bob, sototalETHInPool
is 1 andrsEthSupply
is 1;totalETHInPool
is 1e18 + 1 andrsEthSupply
is 1,rsETH
price is 1e18 * (1e18 + 1);rsETH
.Please see below test case:
Tools Used
Manual Review
Recommended Mitigation Steps
When depositing,
rsETH
should be minted before transferring asset.Assessed type
Math
The text was updated successfully, but these errors were encountered: