Reproduced Exploit

Teller — a zero-value transferFrom clears a lender's prepared share burn

Lender group shares cannot be burned until prepareSharesForBurn has aged past withdrawDelay. Any transfer of those shares calls _afterTokenTransfer, which zeroes the prepared amount and stamps block.timestamp.

Nov 2024•Other•dos•3 min read

Chain

Other

Category

dos

Date

Nov 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. 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: 44213-h-1-lender-group-members-can-be-prevented-from-burning-their. Standalone Foundry PoC and full write-up: 44213-h-1-lender-group-members-can-be-prevented-from-burning-their_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/dos/griefing · vuln/dos/frozen-funds

Reproduction: a self-contained Foundry PoC that compiles and runs offline with only forge-std — no fork and no RPC. Trace: output.txt. PoC: test/44213-h-1-lender-group-members-can-be-prevented-from-burning-their_exp.sol.


Key info#

ImpactHIGH — a prepared withdrawal of 100 underlying reverts, and the tokens stay in the group
ProtocolTeller LenderCommitmentGroupShares._afterTokenTransfer
Vulnerable codethe hook clears the prepared burn even when amount is 0
Bug classERC-20 4.8 transferFrom(0) resets the withdrawal delay
FindingSherlock #24 — Teller lender groups, November 2024 · id 44213
ReportSherlock issue 24
SourceAuditVault finding
Compilersolc 0.8.27, cancun, via IR

TL;DR#

Lender group shares cannot be burned until prepareSharesForBurn has aged past withdrawDelay. Any transfer of those shares calls _afterTokenTransfer, which zeroes the prepared amount and stamps block.timestamp.

OpenZeppelin ERC-20 4.8 allows transferFrom(from, to, 0) with a zero allowance: 0 >= 0 passes, and the hook still runs. No shares move. The victim's burn then reverts with "Shares not prepared for withdraw", and 100 underlying stays in the contract.

The victim's prepare is stored with timestamp 0 so this block stands in for a delay that already elapsed. Repeating the 0-transfer each time the victim prepares again keeps the funds locked. The fixed hook rejects amount == 0, and the burn then pays the 100 underlying.

The vulnerable code#

SOLIDITY
function _afterTokenTransfer(address from, address, uint256) internal {
    poolSharesPreparedToWithdrawForLender[from] = 0;
    poolSharesPreparedTimestamp[from] = block.timestamp; // @> VULN: amount 0 still restarts the delay
}
DIFF
 function _afterTokenTransfer(address from, address, uint256 amount) internal {
+    if (amount == 0) return;
     poolSharesPreparedToWithdrawForLender[from] = 0;
     poolSharesPreparedTimestamp[from] = block.timestamp;
 }

Attack walkthrough#

  1. The victim has 100 shares prepared, and the timestamp is already older than the delay. The group holds 100 underlying. The attacker has no allowance.
  2. The attacker calls transferFrom(victim, victim, 0). The allowance check passes.
  3. The hook sets the prepared amount to 0 and the timestamp to now.
  4. burn reverts. The victim's underlying balance stays 0. The group still holds 100.

Diagrams#

flowchart TD A["Victim has a prepared burn past the delay"] --> B["Attacker calls transferFrom of 0"] B --> C["Allowance check passes because 0 is at least 0"] C --> D["Hook clears the prepared amount and restarts the timestamp"] D --> E["burn reverts and 100 underlying stays locked"]

Impact#

Any lender who has prepared a withdrawal can be reset by an unprivileged caller, forever, at the cost of a zero-value transfer. The underlying they were about to receive stays in the group. In this run that is 100 tokens.

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.