Reproduced Exploit

Renzo — incorrect withdraw queue balance in TVL calculation

1. TVL loops ODs (i) then collateral tokens (j). 2. Withdraw-queue oracle call uses collateralTokens[i] for price but balanceOf token j. 3. With 1 OD and 3 tokens, token0 is priced 3×; tokens 1/2 ignored. 4. Deposit against understated TVL mints excess shares.

Apr 2024Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Apr 2024

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 33495-h-08-incorrect-withdraw-queue-balance-in-tvl-calculation-cod. Standalone Foundry PoC and full write-up: 33495-h-08-incorrect-withdraw-queue-balance-in-tvl-calculation-cod_exp in the evm-hack-registry mirror.


Vulnerability classes: precision-loss · data-corruption/price-manipulation

Reproduction: a self-contained Foundry PoC that compiles & runs in an isolated project with only forge-std — no fork, no RPC, no anvil_state. Full trace: output.txt. PoC: test/33495-h-08-incorrect-withdraw-queue-balance-in-tvl-calculation-cod_exp.sol.


Key info#

ImpactHIGH — withdraw-queue TVL uses the wrong collateral index, understating TVL and minting excess shares
ProtocolRenzo
Vulnerable codeRestakeManager
Bug classprecision-loss
FindingCode4rena — Renzo, 2024-04 · #33495 · reporter josephdara
Reportcode4rena.com/reports/2024-04-renzo
SourceAuditVault
StatusAudit finding — caught in review, not exploited on-chain. Reproduced as a standalone local PoC.
Compiler^0.8.24 (PoC)

This is an audit finding, not a historical on-chain incident. The PoC keeps the vulnerable logic verbatim (marked @> VULN) and reduces dependencies to the minimum needed to show the claimed harm.


TL;DR#

  1. TVL loops ODs (i) then collateral tokens (j).
  2. Withdraw-queue oracle call uses collateralTokens[i] for price but balanceOf token j.
  3. With 1 OD and 3 tokens, token0 is priced 3×; tokens 1/2 ignored.
  4. Deposit against understated TVL mints excess shares.

The vulnerable code#

See test/33495-h-08-incorrect-withdraw-queue-balance-in-tvl-calculation-cod.sol — the @> VULN marker is on the blamed line (line 98 in the synthetic).

Root cause#

Wrong loop index on the oracle token identity for the withdraw-queue contribution.

Preconditions#

Protocol operating conditions that make the path reachable (see finding report). No exotic privileges beyond those the real call path requires.

Attack walkthrough#

From output.txt: the Exploit.run() path executes the attack end-to-end and requires the harm.

Diagrams#

flowchart TD A[Setup reduced protocol state] --> B[Trigger vulnerable path] B --> C[VULN line executes] C --> D[Harm asserted]

Impact#

Miscalculated TVL drives mint/redeem; excess shares dilute honest LPs.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.