Platform: Code4rena
Start Date: 10/11/2023
Pot Size: $28,000 USDC
Total HM: 5
Participants: 185
Period: 5 days
Judge: 0xDjango
Id: 305
League: ETH
Rank: 55/185
Findings: 1
Award: $76.02
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: crack-the-kelp
Also found by: 0xDING99YA, 0xffchain, Aymen0909, Bauchibred, DanielArmstrong, Pechenite, Stormy, T1MOH, ZanyBonzy, ast3ros, bLnk, chaduke, crack-the-kelp, deepkin, deth, jasonxiale, jayfromthe13th, lsaudit, nmirchev8, osmanozdemir1, roleengineer, tallo, zhaojie
76.0163 USDC - $76.02
https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L70
Value of totalAssetAmt
could be calculated incorrectly (less than real), which produces incorrect rsETH price (less than real), which results in incorrect amount of rsETH tokens being minted (greater than real) by calling depositAsset
function on LRTDepositPool. Results in real rsETH price drop.
totalAssetAmt
is calculated incorrect, when asset strategy was changed by LRTConfig admin and previous strategy still holds significant amount of asset, which cannot be withdrawn due to previous strategy paused withdrawals by EigenLayer protocol.
It could happen, as option of several strategies per asset in EigenLayer protocol is ignored by current implementation: LRTConfig stores only one strategy per asset (with ability to update) and to get staked amount by NodeDelegator getAssetBalance
function is used in LRTDepositPool function getAssetDistributionData
.
Prerequisites:
Call flow:
depositAsset
function executes internal _mintRsETH call_mintRsETH
executes internal getRsETHAmountToMint callgetRsETHAmountToMint
makes external LRTOracle getRSETHPrice function function callgetRSETHPrice
makes external LRTDepositPool getTotalAssetDeposits function callgetTotalAssetDeposits
executes internal getAssetDistributionData callgetAssetDistributionData
makes external NodeDelegator getAssetBalance function callgetAssetBalance
receives data related only to strategy#2 and ignores significant amount of staked asset in strategy#1 and returns incorrect asset balance valuegetAssetDistributionData
assigns incorrect value to assetStakedInEigenLayer variablegetTotalAssetDeposits
returns incorrect totalAssetDeposit valuegetRSETHPrice
assigns incorrect totalAssetAmt value and adds significantly less amount to totalETHInPool
, returns significantly less incorrect rsETHPrice
getRsETHAmountToMint
assigns and returns significantly greater incorrect rsethAmountToMint
value_mintRsETH
mints significantly more rsETH than neededTest can be added on request.
Consider in implementation several strategies per asset or store staked amounts inside a protocol and read one slot per asset instead of external calls.
Context
#0 - c4-pre-sort
2023-11-16T20:38:03Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-11-16T20:38:13Z
raymondfam marked the issue as duplicate of #197
#2 - c4-judge
2023-12-01T17:24:53Z
fatherGoose1 marked the issue as unsatisfactory: Invalid
#3 - c4-judge
2023-12-08T17:26:11Z
fatherGoose1 marked the issue as satisfactory