Reproduced Exploit

Derive: wrapped deposit blocks a 5000 bid

deposit credits a wrapped balance to any recipient. _ensureBidderCashBalance then reverts because the bidder is no longer cash-only. The 5000 cash bid does not collect, and settlement books 5000 of shortfall.

Dec 2023•Other•logic•2 min read

Chain

Other

Category

logic

Date

Dec 2023

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: 53724-bids-can-be-blocked-by-depositing-tokens-to-liquidator-sigma. Standalone Foundry PoC and full write-up: 53724-bids-can-be-blocked-by-depositing-tokens-to-liquidator-sigma_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/missing-check · vuln/dos/frozen-funds

Key info#

ProtocolDerive
FindingSigma Prime, AuditVault 53724
Vulnerable codeWrappedERC20.deposit
HarmWrapping 1 token onto the bidder makes the 5000 bid revert. The unbid auction books 5000 of bad debt. The fixed deposit requires approval and the bid collects 5000.
Chainlocal synthetic

TL;DR#

deposit credits a wrapped balance to any recipient. _ensureBidderCashBalance then reverts because the bidder is no longer cash-only. The 5000 cash bid does not collect, and settlement books 5000 of shortfall.

The vulnerable code#

SOLIDITY
    // @> VULN: this wrapped balance is credited to any recipient, with no approval
    mapping(address => uint256) public balanceOf;

Root cause#

Options transfers were gated on recipient approval. Wrapped ERC20 deposits were not, so anyone can plant a non-cash balance on a bidder.

Preconditions#

The bidder has 5000 cash approved and is about to bid. The attacker can wrap 1 unit of underlying onto that same account.

Attack walkthrough#

  1. Wrap 1 of underlying onto the bidder. See output.txt.
  2. balanceOf the bidder becomes 1.
  3. The bidder calls bid for 5000.
  4. _ensureBidderCashBalance reverts.
  5. cashCollected stays 0.
  6. settleUnbid books 5000. The fixed deposit reverts without approval, and the bid collects 5000.

Diagrams#

flowchart TD A["Wrap 1 onto the bidder"] --> B["Bidder is no longer cash only"] B["Bidder is no longer cash only"] --> C["bid of 5000 reverts"] C["bid of 5000 reverts"] --> D["No cash is collected"] D["No cash is collected"] --> E["5000 bad debt is booked"]

Impact#

The shortfall of 5000 is not covered by the bid. The fixed wrapper rejects the unapproved deposit and the bid pulls 5000 cash.

Remediation#

Require the recipient to have approved wrapped deposits before crediting balanceOf.

How to reproduce#

BASH
cd 53724-bids-can-be-blocked-by-depositing-tokens-to-liquidator-sigma_exp
forge test -vv

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.