Reproduced Exploit

Tapioca DAO — AaveStrategy setMultiSwapper bricks compound

1. Constructor approves the initial multiSwapper for rewardToken. 2. setMultiSwapper only stores the new address. 3. New swapper has zero allowance → compound transferFrom fails → withdrawals that compound first brick.

Jul 2023Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Jul 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: 27529-h-39-aavestrategysol-changing-swapper-breaks-the-contract-co. Standalone Foundry PoC and full write-up: 27529-h-39-aavestrategysol-changing-swapper-breaks-the-contract-co_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/wrong-condition · vuln/access-roles · vuln/permanent

Reproduction: self-contained Foundry PoC with only forge-std — no fork, no RPC. Full trace: output.txt. PoC: test/27529-h-39-aavestrategysol-changing-swapper-breaks-the-contract-co.sol.


Key info#

ImpactHIGH — after swapper upgrade, compound() reverts; rewards stuck and withdraw paths that compound first break
ProtocolTapioca DAO
Vulnerable codeAaveStrategy.setMultiSwapper — updates pointer without approve
Bug classIncomplete admin setter / missing allowance transfer
FindingCode4rena — Tapioca, 2023-07 · #27529 · reporter carrotsmuggler
Reportcode4rena.com/reports/2023-07-tapioca
SourceAuditVault
StatusConfirmed by Tapioca (dup #222)
Compiler^0.8.24 (PoC)

TL;DR#

  1. Constructor approves the initial multiSwapper for rewardToken.
  2. setMultiSwapper only stores the new address.
  3. New swapper has zero allowance → compound transferFrom fails → withdrawals that compound first brick.

The vulnerable code#

SOLIDITY
function setMultiSwapper(address _swapper) external onlyOwner {
    emit MultiSwapper(address(swapper), _swapper);
    // @> VULN: no approve / revoke
    swapper = ISwapper(_swapper);
}

Fix: revoke old allowance, assign, approve new (as in ConvexTricryptoStrategy).

Root cause#

Allowance is treated as constructor-only setup, but the swapper is mutable.

Attack walkthrough#

  1. Strategy holds 100 AAVE rewards; initial swapper is approved.
  2. Owner upgrades multiSwapper (routine ops).
  3. Anyone calling compound reverts; rewards remain unswapped; WETH balance stays 0.

Diagrams#

flowchart LR A[Constructor approve old swapper] --> B[setMultiSwapper new] B --> C[New swapper allowance = 0] C --> D[compound transferFrom reverts] D --> E[Rewards stuck / withdraw path bricked]

Impact#

Broken compounding and withdraw liveness after any legitimate swapper upgrade — permanent fund impairment until emergency re-approve.

Taxonomy#

  • genome: wrong-condition, permanent, access-roles, fot-slippage, liquidation-underwater, oracle-freshness
  • sector: dex, governance, lending, token, vault
  • severity: high
  • 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.