Reproduced Exploit

Level Money: USDT withdraw from AaveV3YieldManager reverts and leaves 1000 USDT stuck

USDT is a configured asset of AaveV3YieldManager. withdraw calls IERC20.transfer, which ABI-decodes a bool. USDT's transfer returns no data, so the call reverts. The manager still holds 1000 USDT and the caller receives 0. Calling the same token's transfer directly, without the bool decode, pays th…

Oct 2024•Ethereum•dependency•4 min read

Loss

1000 USDT cannot leave AaveV3YieldManager

Chain

Ethereum

Category

dependency

Date

Oct 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: 46585-usdt-cannot-be-withdrawn-from-aavev3yieldmanager-cantina-non. Standalone Foundry PoC and full write-up: 46585-usdt-cannot-be-withdrawn-from-aavev3yieldmanager-cantina-non_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/dependency/unsafe-external-call · vuln/dos/frozen-funds

Key info#

FieldValue
Loss1000 USDT cannot leave AaveV3YieldManager
Vulnerable contractAaveV3YieldManager.withdraw
Attacker EOA0x1111111111111111111111111111111111111111 (any withdrawer)
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2024-10
Compilersolc 0.8.27, cancun, via IR
Bug classIERC20.transfer expects a bool and USDT's transfer returns nothing

TL;DR#

USDT is a configured asset of AaveV3YieldManager. withdraw calls IERC20.transfer, which ABI-decodes a bool. USDT's transfer returns no data, so the call reverts. The manager still holds 1000 USDT and the caller receives 0. Calling the same token's transfer directly, without the bool decode, pays the 1000 USDT out.

Background#

Cantina, Level Money, October 2024, Mario Poneder. The yield manager is meant to take USDC and USDT, supply them to Aave, and later return the underlying. The report names three raw ERC-20 calls, including AaveV3YieldManager.sol around the withdraw transfer. USDT is not fully ERC-20: transfer does not return a bool. Solidity still tries to decode one. The fix landed in PRs 25 and 26 and is to use SafeERC20.

The vulnerable code#

SOLIDITY
uint256 bal = NonReturningUSDT(token).balanceOf(address(this));
require(bal >= amount, "bal");
IERC20(token).transfer(msg.sender, amount); // @> VULN: USDT.transfer returns no bool
DIFF
- IERC20(token).transfer(msg.sender, amount);
+ IERC20(token).safeTransfer(msg.sender, amount);

safeTransfer accepts an empty return payload. A direct call on the concrete USDT-shaped token does the same, which is the control.

Root cause#

The high-level call through IERC20 appends a decode of 32 bytes of returndata. USDT's transfer returns nothing, returndatasize is 0, and the decoder reverts. The tokens never move. The same pattern breaks transferFrom and approve wherever the code uses the raw interface on USDT.

Preconditions#

  • USDT is the underlying. The manager's underlyingToaToken and tokenToWrapper entries are set, so this is not a missing-configuration revert.
  • The manager already holds 1000 USDT (6 decimals, 1000e6), which is the balance after a successful Aave unwind.
  • The caller asks to withdraw that full balance.

Attack walkthrough#

  1. The caller invokes withdraw(USDT, 1000e6).
  2. The aToken and wrapper lookups succeed.
  3. balanceOf is 1000 USDT and the balance check passes.
  4. IERC20.transfer reverts on the empty return.
  5. The low-level call reports failure, so run() itself does not revert.
  6. The manager still holds 1000 USDT. The caller holds 0.

Diagrams#

flowchart TD A["Manager holds 1000 USDT"] --> B["withdraw loads the aToken and wrapper"] B --> C["Balance check passes"] C --> D["VULN IERC20.transfer expects a bool"] D --> E["USDT returns no data and the call reverts"] E --> F["1000 USDT stays in the manager"] C --> G["Control calls transfer directly and the caller receives 1000"]

Impact#

A user who supplied USDT cannot withdraw it. The 1000 USDT stays in the yield manager. Unwinding the Aave position by hand is the only recovery, which is the break in the intended flow the report describes. The control pays the same 1000 USDT to the caller and leaves the manager empty.

Remediation#

Use SafeERC20 for transfer, transferFrom, and approve on every token the yield manager and the reserve manager touch, including USDT.

How to reproduce#

BASH
cd 46585-usdt-cannot-be-withdrawn-from-aavev3yieldmanager-cantina-non_exp
forge test -vv

test_exploit_usdt_withdraw_reverts_and_locks_1000 asserts the manager still holds 1000 USDT and the caller holds 0. test_control_direct_usdt_transfer_pays_the_caller asserts the direct transfer delivers 1000 USDT. Captured output is output.txt.

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.