code-423n4 / 2023-11-kelp-findings

13 stars 11 forks source link

LRTDepositPool and LRTOracle contracts could become completely disabled because of a bad NodeDelegator #755

Open c4-submissions opened 11 months ago

c4-submissions commented 11 months ago

Lines of code

https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L82-L88 https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L162-L176

Vulnerability details

Impact

The current implementation of the LRTDepositPool contract does not include a function to remove a NodeDelegator from the nodeDelegatorQueue. This absence presents a risk if an externally owned account (EOA) or an incompatible contract is mistakenly added to the queue. Such an error would disrupt key functions that rely on getAssetDistributionData, as this function attempts to call getAssetBalance on each NodeDelegator in the queue. Affected functions: LRTDepositPool: getTotalAssetDeposits, getRsETHAmountToMint, depositAsset LRTOracle: getRSETHPrice

Proof of Concept

The issue arises due to the iteration over nodeDelegatorQueue in getAssetDistributionData and the absence of validation in addNodeDelegatorContractToQueue. https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L82-L88 https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L162-L176

Tools Used

Forge

Recommended Mitigation Steps

Assessed type

DoS

c4-pre-sort commented 11 months ago

raymondfam marked the issue as insufficient quality report

c4-pre-sort commented 11 months ago

raymondfam marked the issue as duplicate of #36

c4-judge commented 10 months ago

fatherGoose1 changed the severity to QA (Quality Assurance)

c4-judge commented 10 months ago

fatherGoose1 marked the issue as grade-b