Kelp DAO | rsETH - alexfilippov314's results

A collective DAO designed to unlock liquidity, DeFi and higher rewards for restaked assets through liquid restaking.

General Information

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

Kelp DAO

Findings Distribution

Researcher Performance

Rank: 123/185

Findings: 1

Award: $2.76

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

2.7592 USDC - $2.76

Labels

bug
downgraded by judge
grade-b
insufficient quality report
QA (Quality Assurance)
duplicate-69
Q-77

External Links

Lines of code

https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/NodeDelegator.sol#L86

Vulnerability details

The NodeDelegator.transferBackToLRTDepositPool function doesn't check that LRT_DEPOSIT_POOL was set: LRTConfig.sol

function getContract(bytes32 contractKey) external view override returns (address) {
    return contractMap[contractKey];
}

NodeDelegator.sol

function transferBackToLRTDepositPool(
    address asset,
    uint256 amount
)
    external
    whenNotPaused
    nonReentrant
    onlySupportedAsset(asset)
    onlyLRTManager
{
    address lrtDepositPool = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);

    if (!IERC20(asset).transfer(lrtDepositPool, amount)) {
        revert TokenTransferFailed();
    }
}

In the case when this address was not set the funds will be transfered to the zero address and will be lost for good.

The probability of this situation is low since in most cases the LRTOracle.getRSETHPrice also uses this address and therefore the LRTDepostPool.depositAsset transaction will be reverted. But in the case when rsEthSupply == 0 the LRTOracle.getRSETHPrice doesn't use LRT_DEPOSIT_POOL. In this case, the flow LRTDepostPool.depositAsset -> LRTDepostPool.transferAssetToNodeDelegator -> NodeDelegator.transferBackToLRTDepositPool can be executed without reverts and funds can be lost.

Impact

Funds can be lost in the NodeDelegator.transferBackToLRTDepositPool if the LRT_DEPOSIT_POOL contract address was not set in the LRTConfig. The probability of such a situation is low but it is better to prevent it completely.

Proof of Concept

-

Tools Used

Manual Review

Consider adding a check that lrtDepositPool is not equal to the zero address in the NodeDelegator.transferBackToLRTDepositPool.

Assessed type

Invalid Validation

#0 - c4-pre-sort

2023-11-16T04:58:00Z

raymondfam marked the issue as insufficient quality report

#1 - c4-pre-sort

2023-11-16T04:58:10Z

raymondfam marked the issue as duplicate of #69

#2 - c4-judge

2023-11-29T20:58:12Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#3 - c4-judge

2023-11-29T21:02:11Z

fatherGoose1 marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter