Skip to content
Business logic Audit finding Intermediate

Potential arbitrage opportunity in the xRenzoDeposit L2 contract

The L2 xRenzoDeposit contract updates its price from an L1 bridge transaction, and a user can watch the L1 mempool for the price update and mint xezETH on L2 before the new price takes effect. If the price change is favourable, the user can later sell the xezETH at the updated price for a profit.

0xCiphky Follow with LessDupes

Originally disclosed on Code4rena

Submitted by 0xCiphky, also found by LessDupes

The sendPrice function in the xRenzoBridge contract calls the getRate function to retrieve the current price of ezETH to ETH and broadcasts it to Layer 2 networks. Subsequently, the price is received by either the ConnextReceiver or CCIPReceiver and invokes the updatePrice function in the xRenzoDeposit contract on L2. However, a potential opportunity exists where a user can monitor the L1 mempool for the sendPrice function call, observe the new price, and sandwich it if profitable.

    /**
     * @notice  Exposes the price via getRate()
     * @dev     This is required for a balancer pool to get the price of ezETH
     * @return  uint256  .
     */
    function getRate() external view override returns (uint256) {
        return lastPrice;
    }

Upon detecting a favourable price change, the user could mint xezETH on L2 before the price adjustment takes effect. Subsequently, when the price change is finalized, the user can sell the xezETH on a protocol that reads the price from the getRate function in the xRenzoDeposit contract, thus profiting from the price discrepancy.

Impact

Severity: Medium. This will allow users to exploit price changes by minting xezETH at a favourable rate before the price update is reflected.

Likelihood: High. Given the visibility of transactions in the mempool and the potential for arbitrage opportunities, it is likely that users will attempt to exploit this.

Recommendation

Since there are two fees associated with L2 deposits, this should help minimize this problem. Additionally, as ezETH is more on the stable side, it is less prone to significant price fluctuations. However, continuous monitoring and adjustment of the update frequency may be necessary to prevent potential exploitation.

jatinj615 (Renzo) acknowledged and commented:

Expected behaviour.


The original report as published on Code4rena, by 0xCiphky. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

Impact

Users could exploit price changes by minting xezETH at a favourable rate before the price update is reflected; the report notes that two L2 deposit fees and ezETH's stability may reduce the opportunity.

What the attacker needed

Ability to watch the L1 mempool; ability to mint xezETH on L2; a protocol that reads the price from getRate

The fix

The report suggests that the existing L2 deposit fees help minimise the problem and that update frequency may need monitoring and adjustment, but the project considered it expected behaviour.

How it was found

  1. Monitor the L1 mempool for the sendPrice function call.
  2. Observe the new price being sent to L2.
  3. Mint xezETH on L2 before the price adjustment takes effect.
  4. After the price change is finalised, sell xezETH on a protocol that reads the price from getRate.

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.

A price used by a deposit contract on a second network is updated by a message from the main network. Because pending transactions are visible before they are confirmed, someone can see the new price coming and buy in at the old price first. If the price moves in their favour, they can sell afterwards for a quick gain.

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.

More by 0xCiphky

View all

11 more disclosed reports, best first.

More from Renzo

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.