Skip to content
Audit finding Advanced

stETH/ETH feed being used opens up to 2 way deposit<->withdrawal arbitrage

The protocol used a market rate feed for stETH/ETH instead of an exchange rate feed, which could allow arbitrage whenever stETH trades at a discount or premium. An attacker could deposit stETH before a depeg and withdraw after, or deposit ETH and withdraw stETH at a premium, to profit.

GalloDaSballo Follow with 0xabhay, SBSecurity and 6 others

Originally disclosed on Code4rena

Submitted by GalloDaSballo, also found by 0xabhay, SBSecurity, zhaojohnson, jokr, p0wd3r, peanuts, GoatedAudits, and d3e4

The stETH/ETH oracle is not a exchange rate feed, it’s a Market Rate Feed, while other feeds are exchange rate feeds.

This opens up ezETH to be vulnerable to:

  • Market Rate Manipulations.
  • Sentiment based Price Action.
  • Duration based discounts.

POC

This opens up to arbitrage anytime stETH trades at a discount (see Liquidations on the 13th of April).

Had withdrawals been open, the following could have been possible:

  • Deposit stETH before the Depeg (front-run oracle update).
  • Get ezETH.
  • Withdraw stETH after the depeg (1% a day, around 365% APR).

As well as:

  • stETH market depegs.
  • Deposit ETH for ezETH.
  • Withdraw stETH at premium (about 1% arbitrage, around 365% APR).

Mitigation

I believe the withdrawal logic needs to be rethought to be denominated in ETH. The suggested architecture would look like the following:

  • Deposit of ETH or LSTs, estimated via a pessimistic exchange rate.
  • Withdraw exclusively ETH, while pricing in slashing, discounts and operative costs.

Assessed type

Oracle

jatinj615 (Renzo) acknowledged and commented:

Expected Behaviour.

alcueca (judge) commented:

It is debatable whether the market or exchange rate is the real price. The market price is the price for an instant trade, while the exchange rate is the price for a trade in the terms of the stETH contract. Renzo is not even using a real market price, which would be retrieved from a DEX. Whatever the choice of oracle, there will be some arbitrage opportunities.

alcueca (judge) commented:

Regarding PJQA here, I do actually know of other protocols working on similar topics that have recognized this as a problem and taken significant steps to avoid it.

Mitigation from sponsor on #424, along with explanation on why both groups should be merged. Namely, that using the market rate for stETH/ETH is what enables arbitraging between different collaterals, and that the fix from this finding will also fix the duplicates.


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

Root cause

Likely the protocol used a market rate feed for stETH/ETH instead of an exchange rate feed, creating a price discrepancy that enables arbitrage.

Impact

If withdrawals were open, an attacker could arbitrage stETH price movements, potentially earning around 365% APR, though the report notes this was not yet possible because withdrawals were not open.

What the attacker needed

Withdrawals must be open; stETH trades at a discount or premium

The fix

The withdrawal logic should be rethought to be denominated in ETH, with deposits estimated via a pessimistic exchange rate and withdrawals exclusively in ETH while pricing in slashing, discounts and operative costs.

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 feed tells a smart contract how much one token is worth in another. Here, the feed used the market price of stETH, which can move up and down, rather than the fixed exchange rate from the stETH contract. That mismatch could let someone buy low and sell high within the protocol, making a profit at the expense of other users.

More by GalloDaSballo

View all

30 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.