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.
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.
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
- Monitor the L1 mempool for the sendPrice function call.
- Observe the new price being sent to L2.
- Mint xezETH on L2 before the price adjustment takes effect.
- 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.