Skip to content
Audit finding Intermediate

Incorrect exchange rate provided to Balancer pools

LessDupes Follow with Bauchibred

Originally disclosed on Code4rena

Submitted by LessDupes, also found by Bauchibred

The xRenzoDeposit contract, apart from being the entry point for deposits on L2s, also acts as a rate provider for Balancer pools on L2s, allowing them to determine the exchange rate between xezWETH and WETH tokens. Rate providers are crucial for Balancer pools to calculate token prices and determine yield protocol fees during joins and exits, as explained in the Balancer documentation.

However, the getRate() function in xRenzoDeposit does not provide the correct exchange rate. It simply returns the lastPrice state variable, which:

  • May be stale if updatePrice() or updatePriceByOwner() have not been called recently.
  • May be older than the rate provided by oracle.getMintRate().
  • Can be different from the rate at which xezETH are minted in _deposit(), which uses the newest of the oracle and internal lastPrice values, opening up arbitrage opportunities.

Impact

By providing an incorrect and potentially outdated exchange rate, xRenzoDeposit can cause Balancer pools to misprice xezWETH relative to WETH. This can lead to incorrect yield calculations and enable manipulation of pool joins and exits.

Proof of Concept

  1. xRenzoDeposit is set as the rate provider between xezWETH and WETH for a Balancer pool.
  2. The price of ezETH relative to ETH changes on L1, but the receiver fails and updatePrice() is not called on xRenzoDeposit.
  3. However, the oracle feed still provides accurate data.
  4. A user executes an operation on a WETH/xezETH Balancer pool, which calls getRate() on xRenzoDeposit to fetch the price.
  5. getRate() returns the stale price from the internal lastPrice variable.
  6. The Balancer pool uses this incorrect rate for its calculations, leading to mispricing of xezWETH and potential manipulation.

Recommended Mitigation Steps

Update the getRate() function to provide the same exchange rate used when minting xezETH. This can be achieved by calling getMintRate() instead of returning lastPrice directly:

- return lastPrice;
+ (uint256 rate, uint256 timestamp) = getMintRate();
+ require(block.timestamp <= timestamp + 1 days, "Price is stale");
+ return rate;

This ensures that the rate provided to Balancer pools is consistent with the actual minting rate and is not stale.

jatinj615 (Renzo) confirmed

Renzo mitigated:

The PR adds staleness check in getRate function for balancerPools on L2.

Status: Mitigation confirmed. Full details in reports from 0xCiphky, grearlake, Fassi_Security, LessDupes, and Bauchibred.


The original report as published on Code4rena, by LessDupes. 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.

What is known

A medium-severity security bug in Renzo. Code4rena made it public on 7 June 2024. Found in the 2024-04-renzo audit contest (finding M-12), also found by 1 other warden.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

More by LessDupes

View all

6 more disclosed reports, best first.

More from Renzo

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.