Reproduced Exploit

Peapods: an arbitrary pod drains PodUnwrapLocker

debondAndLock takes any pod. The balance-delta loop credits every asset the pod returns. A pod that returns the same token twice records one incoming transfer on both slots. The caller supplies 100 peas, the lock stores 100 and 100, and the zero-cooldown withdraw pays 200. The 100 peas already in t…

Jan 2025•Ethereum•input-validation•3 min read

Loss

100 peas that an honest debond left in the locker

Chain

Ethereum

Category

input-validation

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. 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: 52746-h-1-podunwraplocker-can-be-drained-due-to-an-arbitrary-input. Standalone Foundry PoC and full write-up: 52746-h-1-podunwraplocker-can-be-drained-due-to-an-arbitrary-input_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/input-validation/missing · vuln/logic/missing-validation

Key info#

FieldValue
Loss100 peas that an honest debond left in the locker
Vulnerable contractPodUnwrapLocker.debondAndLock
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-01
Compilersolc 0.8.27, cancun, via IR
Bug classNo pod allowlist, so one token listed twice is credited twice

TL;DR#

debondAndLock takes any pod. The balance-delta loop credits every asset the pod returns. A pod that returns the same token twice records one incoming transfer on both slots. The caller supplies 100 peas, the lock stores 100 and 100, and the zero-cooldown withdraw pays 200. The 100 peas already in the locker from an honest debond are the extra 100.

The vulnerable code#

SOLIDITY
for (uint256 i = 0; i < _tokens.length; i++) {
    _receivedAmounts[i] = IERC20(_tokens[i]).balanceOf(address(this)) - _balancesBefore[i]; // @> VULN: one token listed twice is credited for the same balance increase on every slot
}

There is no check that _pod is a pod the protocol deployed. The pod's config().debondCooldown is 0, so withdraw runs in the same transaction. The fix is to accept only known pods.

Preconditions#

  • An honest user has debonded a one-asset pod. The locker holds 100 peas and that lock is not yet withdrawn.
  • The caller holds 100 peas and approves a contract that returns [peas, peas] from getAllAssets, pulls 100 peas in debond, and reports a cooldown of 0.

Attack walkthrough#

  1. Both slots snapshot the locker balance of 100.
  2. debond transfers 100 peas from the caller into the locker. The balance is 200.
  3. Each slot stores 200 - 100. The lock is [100, 100].
  4. withdraw transfers 100 and then 100. The locker balance is 0.
  5. The caller started the transaction with 100 and ends with 200.
  6. The honest user's withdraw of their own lock reverts. The control locker rejects any pod other than the legitimate one, so the 100 peas stay.

Diagrams#

flowchart TD A["Locker already holds 100 peas from an honest debond"] --> B["Caller passes a pod that lists peas twice"] B --> C["VULN: both slots record the same 100 increase"] C --> D["Lock is 100 and 100 after a 100 transfer"] D --> E["Cooldown is 0 so withdraw pays 200"] E --> F["Caller is up 100 and the honest lock cannot be paid"] B --> G["Control rejects any pod that is not the known one"] G --> H["Honest 100 peas stay in the locker"]

Impact#

The caller spends 100 peas and receives 200. The 100 peas that belonged to the earlier debond are gone, and that user's withdraw does not pay them.

How to reproduce#

BASH
cd 52746-h-1-podunwraplocker-can-be-drained-due-to-an-arbitrary-input_exp
forge test -vv

test_exploit_double_counts_one_deposit asserts a profit of 100 and an empty locker. test_control_unknown_pod_is_rejected asserts the malicious pod reverts and the honest 100 remains.

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.