Reproduced Exploit

Liquid Ron — totalAssets wrong when operatorFeeAmount > 0

1. Operator fee sits in the vault balance and is tracked in operatorFeeAmount. 2. totalAssets() still counts that fee toward share pricing. 3. New depositor mints fewer shares (priced against inflated assets). 4. Operator fetchOperatorFee removes the fee from the vault → totalAssets drops.

Jan 2025Otheruntagged3 min read

Chain

Other

Category

untagged

Date

Jan 2025

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: 50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat. Standalone Foundry PoC and full write-up: 50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat_exp in the evm-hack-registry mirror.


Vulnerability classes: fee-accounting · arithmetic/precision-loss · data-corruption/accounting-error · loss-of-funds/indirect-loss

Reproduction: self-contained Foundry PoC with only forge-std — no fork. Full trace: output.txt. PoC: test/50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat_exp.sol.


Key info#

ImpactHIGH — new depositors mint against inflated assets including operator fee; redeem less after fee withdrawal
ProtocolLiquid Ron — LiquidRon.totalAssets
Vulnerable codetotalAssets() = balance + staked + rewards without subtracting operatorFeeAmount
Bug classFee included in ERC-4626 asset base
FindingCode4rena 2025-01-liquid-ron · #50051 · H-01 · reporter 0xvd
Reportcode4rena.com/reports/2025-01-liquid-ron
SourceAuditVault
StatusConfirmed and mitigated (subtract operatorFeeAmount).
Compiler^0.8.24 (PoC)

TL;DR#

  1. Operator fee sits in the vault balance and is tracked in operatorFeeAmount.
  2. totalAssets() still counts that fee toward share pricing.
  3. New depositor mints fewer shares (priced against inflated assets).
  4. Operator fetchOperatorFee removes the fee from the vault → totalAssets drops.
  5. Depositor redeems less than previewRedeem at deposit time — loss.

The vulnerable code#

SOLIDITY
function totalAssets() public view override returns (uint256) {
    // @> VULN: operator fee included in asset base
    return super.totalAssets() + getTotalStaked() + getTotalRewards();
    // FIX: … - operatorFeeAmount;
}

Root cause#

Operator fee is an accounting liability (claimable by operator) but is treated as user-backing assets in the 4626 totalAssets formula.


Preconditions#

  • operatorFeeAmount > 0 (after harvest).
  • New user deposits, then operator claims fee before user redeems.

Attack walkthrough#

  1. User1 deposits 100 ETH.
  2. Harvest books 10 ETH operator fee (balance still holds it).
  3. User2 deposits 100 ETH while totalAssets includes the 10 fee.
  4. Operator fetches fee.
  5. User2 redeems → receives strictly less than pre-fee preview.

Diagrams#

sequenceDiagram participant U1 as User1 participant U2 as User2 participant V as LiquidRon participant Op as Operator U1->>V: deposit 100 Op->>V: harvest fee=10 Note over V: totalAssets includes fee U2->>V: deposit 100 underpriced shares Op->>V: fetchOperatorFee Note over V: totalAssets drops by 10 U2->>V: redeem V-->>U2: less than previewed assets

Impact#

Consistent dilution of deposits whenever a non-zero operator fee is outstanding; can also make fee irredeemable if vault is emptied.


Taxonomy#

  • genome: fee-accounting, arithmetic/precision-loss, data-corruption/accounting-error, loss-of-funds/indirect-loss
  • severity/high · sector/vault · platform/code4rena

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.