The amount of xezETH in circulation will not represent the amount of ezETH tokens 1:1
The protocol mints xezETH on L2 based on the current ezETH valuation, but later mints ezETH on L1 at a different valuation, causing a mismatch between xezETH and ezETH in circulation. Since the lockbox always exchanges them 1:1, some xezETH can become worthless and impossible to redeem for ezETH.
zzykxx Follow with 0x007, GoatedAudits and 6 others
Originally disclosed on Code4rena
Submitted by zzykxx, also found by 0x007, GoatedAudits, 0xCiphky, jokr, mt030d, fyamf, LessDupes, and GalloDaSballo
The protocol allows to deposit ETH/WETH (or the specific chain native currency) on a supported L2 in order to mint ezETH tokens, this is the process:
- User mints
xezETHon L2s viaxRenzoDeposit::deposit()in exchange for eitherETHorWETH. ThexezETHare minted based on the currentezETHvaluation. - After some time the bridge sweepers transfer the
ETH/WETHcollected to the L1, viaxRenzoDeposit::sweep(). The funds are transferred to thexRenzoBridgecontract on L1 via Connext. - Connext calls
xRenzoBridge::xReceive()on L1 which will receive theETH/WETHand deposit them in the protocol viaRestakeManager::depositETH(). This will mintezETHtokens based on the currentezETHvaluation, theezETHtokens will then be locked in the lockbox in exchange forxezETH, which are then immediately burned because an equivalent amount should have already been minted on the L2 during step1.
Theoretically, the amount of xezETH tokens minted during step 1 should be the same as the amount of ezETH tokens minted during step 3, but because on both steps the tokens are minted at the current valuation, and the valuation changes over time, there will be a discrepancy between the amount of xezETH and ezETH tokens in circulation.
This is an issue because XERC20Lockbox::withdraw() always exchanges xezETH for ezETH 1:1.
Impact
The price of ezETH is expected to increase over time. This will create a situation where there will be more xezETH in circulation than ezETH, rendering some xezETH worthless and impossible to redeem for ezETH.
A situation in which the ezETH valuation decreases instead of increasing is also problematic, because the protocol will mint less xezETH than it should.
The discrepancy will become bigger and bigger with time.
Proof of Concept
As an example, let’s assume ezETH valuation is currently 1 ETH:
- Alice deposits
1 ETHon L2 and receives1 xezETH. - Some time passes and the valuation of
ezETHincreases to2ETH(unrealistic, but allows simple math). - The bridge sweeper calls
sweep(), transferring the1 ETHto thexRenzoBridgecontract on L1. - The
xRenzoBridgedeposits the received1 ETHin theRestakeManager, which mints0.5 ezETHbecause theezETHvaluation doubled. - The
0.5 ezETHis locked in the lockbox,0.5 xezETHare minted in return and immediately burned.
The situation now is the following:
- Alice has
1 xezETHon L2. - The lockbox contains
0.5 ezETHon L1.
Alice can at best redeem 0.5 xezETH in exchange for 0.5 ezETH, and the remaining 0.5 xezETH is worthless. The amount of value she can redeem is the correct one, (1 ETH), but now there are xezETH in circulation that are not backed by ezETH.
Recommended Mitigation Steps
The protocol should track the amount of xezETH tokens minted via xRenzoDeposit::deposit() on the L2 and mint the equivalent amount of ezETH tokens on L1 when xRenzoBridge::xReceive() is executed by passing the necessary data on the xcall() to Connext.
If this is implemented it’s possible for the valuation of ezETH tokens to change instantly after xRenzoBridge::xReceive() is executed, this is because the amount of ezETH tokens is not minted based on the current valuation anymore. As explained in other reports, the protocol will be subject to instant ezETH valuation changes (increase/decrease) no matter what (rewards, slashing, penalties), and should gracefully handle these situations via appropriate deposit and withdrawals queues.
jatinj615 (Renzo) acknowledged and commented:
Yes, theoretically it is correct. But the protocol tackles this by sending the updated mint rate of ezETH frequently to L2s and also sweeps funds every hour if above batch size keeping the collateralization in place for ezETH. Also the
bridgeRouterFee(5 bps) deducted on L2 if the transactions goes through slow path (during which mint rate of ezETH can rise) the extra 5 bps routerFee deducted on L2 is accumulated in minting ezETH on L1 inxRenzoBridge::xReceiveinstead of getting deducted by connext routers.
The long term effect of this is akin to bad debt in lending protocols. Eventually, the protocol or the (last) users need to assume the losses.
I think severity of this issue should be Medium instead of High because there is no direct loss of funds possible here. If the ratio of xezETH to ezETH is not equal 1:1 in any case then it is only possible and the protocol sends the updated mint rate of ezETH frequently to L2s to avoid this situation. Furthermore, According to C4 docs:
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
Stated assumptions and external requirement such as oracle delay are required to face to this issue.
@alcueca - to add more to it as I have explained in the comment above and discussion in #70. The ezETH in prod is over collateralised due to the fact that in some cases (when connext routers don’t have enough liquidity to process fast path) the 5bps deducted on L2 is used to collateralise ezETH on L1 which is why lockbox currently has more ezETH against the xezETH minted on L1. Team has been monitoring and keeping a track on it.
Considering the above argument, please confirm on the severity.
Respectfully, I believe this should remain as High severity:
- The finding clearly demonstrates a realistic scenario where the system could become insolvent, resulting in a loss of funds for users. Despite the current over-collateralization and precautions, there remains a long-term risk.
- The audited implementation contains blockages that will affect efforts to maintain collateralization for ezETH. For example, if the MaxTVL is reached, the protocol cannot deposit in L1, causing an accumulation of minted L2 tokens until it becomes possible to deposit again, which could take a significant amount of time.
- This issue can be intentionally exploited by users whenever the price on the L1 side is higher than on the L2 side.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the protocol mints xezETH and ezETH at different times using the current valuation at each moment, without tracking the exact amount of xezETH minted on L2 to mint an equivalent amount of ezETH on L1.
Impact
Some xezETH could become worthless and impossible to redeem for ezETH, and the discrepancy may grow over time; the protocol mitigates this by frequently updating the mint rate and sweeping funds, but the risk remains.
What the attacker needed
EzETH valuation changes between L2 mint and L1 mint; user deposits on L2; bridge sweeper transfers funds to L1
The fix
The protocol should track the amount of xezETH minted on L2 and mint the equivalent amount of ezETH on L1 when the bridge receives the funds.
How it was found
- Alice deposits 1 ETH on L2 and receives 1 xezETH.
- Some time passes and the valuation of ezETH increases to 2 ETH.
- The bridge sweeper calls sweep(), transferring the 1 ETH to the xRenzoBridge contract on L1.
- The xRenzoBridge deposits the received 1 ETH in the RestakeManager, which mints 0.5 ezETH because the ezETH valuation doubled.
- The 0.5 ezETH is locked in the lockbox, 0.5 xezETH are minted in return and immediately burned.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a cross-chain token system where users deposit funds on a layer-2 network and receive a receipt token called xezETH. Later, the protocol moves the funds to the main chain and creates the main token ezETH, but the exchange rate between the two tokens can change over time. Because the system always swaps them one-for-one, a mismatch can leave some receipt tokens unbacked and worthless.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.