Reproduced Exploit

Blueberry: a deposit during the L1 pre-credit mints extra shares

The vault starts with 1000 USDC and 1000 shares. transferToL1(500) debits the EVM balance immediately and does not credit L1 until creditL1. tvl sums the contract balance and the L1 spot balance, so it reports 500 while 500 is in flight. A 100 USDC deposit mints 100 1000 / 500 = 200 shares. After t…

Apr 2025•Ethereum•arithmetic•3 min read

Loss

Depositor turns 100 USDC into 183.333 USDC. Profit is 83.333 USDC

Chain

Ethereum

Category

arithmetic

Date

Apr 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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 61480-h-03-users-can-exploit-tvl-during-evm-to-l1-transfer-causing. Standalone Foundry PoC and full write-up: 61480-h-03-users-can-exploit-tvl-during-evm-to-l1-transfer-causing_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/arithmetic/rounding · vuln/logic/price-calculation

Key info#

FieldValue
LossDepositor turns 100 USDC into 183.333 USDC. Profit is 83.333 USDC
Vulnerable contractEscrowVault.tvl
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-04
Compilersolc 0.8.27, cancun, via IR
Bug classTVL omits tokens that have left the EVM and are not yet on L1

TL;DR#

The vault starts with 1000 USDC and 1000 shares. transferToL1(500) debits the EVM balance immediately and does not credit L1 until creditL1. tvl sums the contract balance and the L1 spot balance, so it reports 500 while 500 is in flight. A 100 USDC deposit mints 100 * 1000 / 500 = 200 shares. After the credit, TVL is 1100 and supply is 1200. Redeeming 200 shares pays 200/1200 * 1100 = 183.333 USDC. Profit is 83.333 USDC, taken from the other shareholders.

The vulnerable code#

SOLIDITY
function tvl() public view returns (uint256 tvl_) {
    tvl_ = l1Spot;
    tvl_ += usdc.balanceOf(address(this)); // @> VULN: USDC that already left for L1 is not counted until creditL1
}

The report's fixes are to count in-flight balances, or to pause deposits until L1 credits them.

Root cause#

The EVM debit and the L1 credit are not the same moment. tvl only reads the two balances that are zero during the gap. Share price is tvl / supply, so the gap mints too many shares. When the missing USDC reappears, those shares are a claim on assets the depositor did not bring.

Preconditions#

  • Vault holds 1000 USDC against 1000 shares.
  • An admin transfer of 500 USDC to L1 has been started and not yet credited.
  • Deposits are still open. The attacker has 100 USDC.

Attack walkthrough#

  1. transferToL1(500). Contract balance is 500. inFlight is 500. tvl is 500.
  2. Deposit 100. Shares minted are 200.
  3. creditL1. L1 spot is 500. Contract balance is 600. tvl is 1100. Supply is 1200.
  4. Redeem 200 shares. Payout is 183.333 USDC.
  5. Attacker USDC is 83.333 above the starting 100.

Diagrams#

flowchart TD A["Vault has 1000 USDC and 1000 shares"] --> B["500 USDC is sent toward L1 and leaves the EVM balance"] B --> C["VULN tvl reads 500 because in-flight value is omitted"] C --> D["100 USDC deposit mints 200 shares"] D --> E["L1 credits the 500 and TVL is 1100"] E --> F["200 shares redeem for 183.333 USDC"]

Impact#

Existing shareholders are diluted by 83.333 USDC on this deposit. The same window works for any size up to the understated TVL. Counting inFlight in tvl would have priced the deposit at 1 USDC per share.

Remediation#

Add the in-flight amount to tvl until creditL1, or reject deposits and redemptions while inFlight is non-zero.

How to reproduce#

BASH
cd 61480-h-03-users-can-exploit-tvl-during-evm-to-l1-transfer-causing_exp
forge test -vv

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.