Renzo - Hajime's results

A protocol that abstracts all staking complexity from the end-user and enables easy collaboration with EigenLayer node operators and a Validated Services (AVSs).

General Information

Platform: Code4rena

Start Date: 30/04/2024

Pot Size: $112,500 USDC

Total HM: 22

Participants: 122

Period: 8 days

Judge: alcueca

Total Solo HM: 1

Id: 372

League: ETH

Renzo

Findings Distribution

Researcher Performance

Rank: 48/122

Findings: 1

Award: $18.20

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

18.1958 USDC - $18.20

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
sufficient quality report
:robot:_28_group
duplicate-103

External Links

Lines of code

https://github.com/code-423n4/2024-04-renzo/blob/519e518f2d8dec9acf6482b84a181e403070d22d/contracts/RestakeManager.sol#L244-L263

Vulnerability details

Impact

The user will not be able to withdraw a collateral asset that he has deposited if the asset is removed. In WithdrawQueue.withdraw() there is a check for supported tokens: if (withdrawalBufferTarget[_assetOut] == 0) revert UnsupportedWithdrawAsset(); withdrawalBufferTarget is synchronized with collateralTokens[].

After calling removeCollateralTokens the asset is no longer supported. The developers say that the amount of the removed asset is immediately output manually from the EigenLayer via OperatorDelegator.queueWithdrawals to which IERC20[] calldata tokens, uint256[] calldata tokenAmounts are passed as parameters,but these lists do not include deleted assets, because after calling removeCollateralTokens the assets are simply remove without consideration.

This causes the funds to get stuck

Proof of Concept

function removeCollateralToken( IERC20 _collateralTokenToRemove ) external onlyRestakeManagerAdmin { // Remove it from the list uint256 tokenLength = collateralTokens.length; for (uint256 i = 0; i < tokenLength; ) { if (address(collateralTokens[i]) == address(_collateralTokenToRemove)) { collateralTokens[i] = collateralTokens[collateralTokens.length - 1]; collateralTokens.pop(); emit CollateralTokenRemoved(_collateralTokenToRemove); return; } unchecked { ++i; } }

Tools Used

Manual

create 'blacklist' type arrays into which you can loop through and withdraw the remaining asset funds

Assessed type

Other

#0 - c4-judge

2024-05-17T14:03:51Z

alcueca changed the severity to 3 (High Risk)

#1 - c4-judge

2024-05-17T14:05:47Z

alcueca marked the issue as unsatisfactory: Invalid

#2 - c4-judge

2024-05-20T04:34:14Z

alcueca changed the severity to 2 (Med Risk)

#3 - c4-judge

2024-05-20T04:41:25Z

alcueca marked the issue as satisfactory

Findings Information

Awards

18.1958 USDC - $18.20

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
sufficient quality report
:robot:_28_group
duplicate-103

External Links

Lines of code

https://github.com/code-423n4/2024-04-renzo/blob/519e518f2d8dec9acf6482b84a181e403070d22d/contracts/RestakeManager.sol#L274

Vulnerability details

Impact

the amount to be returned to the user will be incorrect because of the incorrect totalTVL value that calculateTVLs returns.This happens when the funds of remove assets get stuck in the protocol (although the developers claim that the admin manually removes the sums of deleted assets, but this is not the case). In case when a user deposited an asset and it was remove from the supported tokens, the result is that the amount gets stuck and is not taken into account in calculateTVLs.

calculateTVLs is calculated only on collateralTokens [] (supported tokens), it returns the value of totalTVL which is used to calculate amountRedeem as a result the user gets an incorrect amount.

Proof of Concept

uint256 amountToRedeem = renzoOracle.calculateRedeemAmount( _amount, ezETH.totalSupply(), totalTVL //! wrong );

Tools Used

manual

Assessed type

Context

#0 - CloudEllie

2024-05-10T17:40:20Z

Adjusting duplicate grouping per validator @0xJuancito's recommendation

#1 - c4-judge

2024-05-17T13:56:56Z

alcueca marked the issue as not a duplicate

#2 - c4-judge

2024-05-17T13:57:04Z

alcueca marked the issue as duplicate of #464

#3 - c4-judge

2024-05-17T14:03:49Z

alcueca changed the severity to 3 (High Risk)

#4 - c4-judge

2024-05-17T14:04:09Z

alcueca marked the issue as duplicate of #97

#5 - c4-judge

2024-05-17T14:05:45Z

alcueca marked the issue as unsatisfactory: Invalid

#6 - c4-judge

2024-05-20T04:34:15Z

alcueca changed the severity to 2 (Med Risk)

#7 - c4-judge

2024-05-20T04:41:18Z

alcueca marked the issue as satisfactory

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