Withdrawals logic allows MEV exploits of TVL changes and zero-slippage zero-fee swaps
Withdrawal amounts are fixed at request time using current oracle prices and TVL, so an attacker can sandwich price or TVL changes by depositing before and requesting withdrawal after, capturing value at no cost beyond gas. Renzo also acts as a zero-slippage, zero-fee oracle-priced exchange, letting holders of a falling asset front-run the price drop and withdraw a different asset at the old price.
Submitted by guhu95, also found by cu5t0mpeo, bill, t0x1c, 0xCiphky, gjaldon (1, 2), 0xabhay (1, 2), WildSniper (1, 2, 3), 0rpse, GoatedAudits (1, 2, 3), honey-k12 (1, 2), Bauchibred (1, 2), jokr, blutorque (1, 2), Tendency (1, 2), crypticdefense (1, 2), Fassi_Security (1, 2), SBSecurity (1, 2, 3), peanuts (1, 2), tapir (1, 2, 3), MSaptarshi, kennedy1030 (1, 2), OMEN, LessDupes (1, 2), 0x007, ilchovski, zzykxx (1, 2, 3), gumgumzum, stonejiajia, Audinarey, RamenPeople, Ocean_Sky, 0x73696d616f, underdog, josephdara, p0wd3r, aslanbek, d3e4, KupiaSec, grearlake (1, 2), and GalloDaSballo
Deposit and withdrawal requests can be done immediately with no costs or fees, and both use the current oracle prices and TVL calculation (deposit, and withdraw). Crucially, the withdrawal amount is calculated at withdrawal request submission time instead of at withdrawal claim time. Any small change in either ezETH value or in the price of a collateral token can be exploited at no cost by MEV. Specifically, if the price increases, a deposit is made before the increase, and a withdrawal request immediately after.
Additionally, in case of a supported LST’s sudden change in price (for example, due to price manipulation, an exploit of that LST, due to consensus layer penalties (slashing), or liquidity issues), external holders of that LST may frontrun the change, deposit the LST into Renzo, and immediately request a withdrawal of another asset (e.g., native ETH). In such situations, Renzo functions as a zero-slippage zero-fees oracle-price-based DEX for LSTs and ETH up to the TVL cap for the affected LST. Zero-slippage zero-fee oracle-price-based designs are notoriously vulnerable to both oracle manipulation and oracle latency attacks if not carefully prevented.
Impact
The newly introduced frontrunning vector, due to incurring only gas fees, and no fee that is proportional to the size of the “trade”, allows profitably exploiting most TVL and oracle price changes, and exploiting previously exploitable updates (via Balancer’s usage of getRate()) and even more profitably via the new vector.
The impact is that value, that otherwise should be distributed to ezETH holders, is constantly lost to MEV.
Additionally, ezETH holders lose value due to facilitating asset swaps with no slippage and no fees based on outdated oracle prices.
Proof of Concept
Scenario 1 (MEV, price increase):
- A transaction that will increase the TVL value without minting or burning ezETH, such as a Chainlink oracle update or EigenLayer rewards withdrawal, is observed.
- An attacker sandwiches the transaction by depositing asset A right before it (minting ezETH to themselves).
- The attacker completes the sandwich by submitting a withdrawal request for asset A after the “target” transaction. This sends the ezETH to
WithdrawQueue, and credits the attacker with a larger amount of A than was just deposited, corresponding to the updated price of ezETH. - The attacker realizes an immediate, same block profit - a larger amount of the same asset, due to the price increase and credit of future withdrawal amount, and no fee being charged.
- Value that would otherwise be distributed to holders of ezETH was lost to the attacker.
Scenario 2 (malicious):
- Asset A experiences a sharp price decline due to slashing, exploit, or other factors.
- An attacker borrows LST asset A from on-chain lending protocols. This is done to reduce the assets available for others to short the price manipulation of the next step.
- The attacker buys up even more of the LST on CEX and DEX, running up the price of that asset, such that a manipulated price is reported by oracles.
- The attacker deposits all asset A into Renzo, being credited with an outsized amount of ezETH due to the inflated price of the collateral.
- The attacker immediately submits a withdrawal request of asset B, which upon conversion uses the inflated value of asset A in Renzo’s TVL.
- 7 days later, upon withdrawal claiming, the attacker withdraws the inflated amount of asset B.
Scenario 3 (MEV, price decrease, zero-slippage zero-fees DEX):
- A supported LST experiences a sudden change in price due to factors such as price manipulation, an exploit of that LST, consensus layer penalties (slashing), or liquidity issues.
- Existing external holders of the LST, or arbitrageurs borrowing the asset, frontrun the transaction that changes the oracle price by depositing the LST into Renzo, and immediately requesting a withdrawal of another asset (e.g., native ETH or another LST). Using Renzo as a zero-slippage oracle-price-based DEX.
- After the withdrawal delay, the attackers claim their withdrawal, receiving the other asset at the pre-change price, effectively exploiting the ezETH holders.
Recommended Mitigation Steps
The redemption conversion should be performed at both request and claim time. If it results in a lower redeem value, that value should be used for the claim instead of the initial redeem amount. Additionally, a rate limit or a short delay on deposits with similar protection can be added as well.
function claim(uint256 withdrawRequestIndex) external nonReentrant {
...
+ // All the code converting from ezETH amount to amountToRedeem as is done in withdraw()
+ if (amountToRedeem < _withdrawRequest.amountToRedeem) {
+ _withdrawRequest.amountToRedeem = amountToRedeem;
+ }
}
Assessed type
MEV
The sponsor’s comment in #259 is relevant here, on why withdrawals are priced on
withdraw, and notclaim. The resulting implementation might have to take a trade-off between being arbitraged one way or another, or opt for a different implementation altogether.
The PR reduces the risk of arbitrage at withdraw by calculating the amount of withdrawing asset at time of withdraw as well as claim and returns the min of both amount to user.
Status: Mitigation confirmed. Full details in reports from 0xCiphky, grearlake, and Bauchibred.
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
Value that should go to ezETH holders is continuously lost to MEV, and holders also lose out when the protocol is used as a zero-slippage, zero-fee exchange at stale oracle prices.
What the attacker needed
Ability to submit transactions and pay gas; a price or TVL change to front-run; for scenario 2, borrowed or purchased LST to inflate price
The fix
The conversion should be recalculated at claim time and the lower of the request-time and claim-time amounts used; a rate limit or short delay on deposits was also suggested, and the sponsor mitigated by calculating the amount at both withdraw and claim and returning the minimum.
How it was found
- Observe a transaction that will increase TVL without minting or burning ezETH, such as an oracle update.
- Deposit asset A right before that transaction to mint ezETH.
- Submit a withdrawal request for asset A after the target transaction.
- Receive credit for a larger amount of asset A based on the updated price, with no fee charged.
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 decentralised finance (DeFi) protocol where people deposit tokens and receive a receipt token called ezETH. When they later ask to withdraw, the amount they will get is calculated immediately, using the current market price, rather than when they actually collect the money days later. An attacker can watch for a price change, deposit just before it, and request a withdrawal just after, so they lock in a better rate than they should get, taking value from other holders.
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.