Reproduced Exploit

Etherspot: a session key approves itself and drains the wallet

A session is locked to 100 USDT and 1 WETH. _validateSingleCall returns true for every ERC-20 approve and never reads the spender or the amount. The session key makes the wallet approve itself for type(uint256).max on USDC, USDT, WETH, and WBTC, then transferFroms each balance. USDC was not in the…

Oct 2025•Ethereum•access-control•3 min read

Loss

The session key takes 1,000 USDC that was not in its lock, plus the wallet's USDT, WETH, and WBTC. The wallet…

Chain

Ethereum

Category

access-control

Date

Oct 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: 62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n. Standalone Foundry PoC and full write-up: 62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/missing-auth

Key info#

FieldValue
LossThe session key takes 1,000 USDC that was not in its lock, plus the wallet's USDT, WETH, and WBTC. The wallet ends at 0
Vulnerable contractCredibleAccountModule._validateSingleCall
Attacker EOA0x1111111111111111111111111111111111111111 (the session key owner)
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-10
Compilersolc 0.8.27, cancun
Bug classapprove returns true for any spender and any amount

TL;DR#

A session is locked to 100 USDT and 1 WETH. _validateSingleCall returns true for every ERC-20 approve and never reads the spender or the amount. The session key makes the wallet approve itself for type(uint256).max on USDC, USDT, WETH, and WBTC, then transferFroms each balance. USDC was not in the lock. The session key receives 1,000 USDC. The wallet's four token balances are 0.

The vulnerable code#

SOLIDITY
bytes4 selector = bytes4(_callData);
if (selector == APPROVE) return true; // @> VULN: approve of any spender and any amount is allowed
DIFF
- if (selector == APPROVE) return true;
+ if (selector == APPROVE) {
+     (address spender, uint256 amount) = abi.decode(_callData[4:], (address, uint256));
+     require(spender == address(this), "spender");
+     require(amount <= lockedAmount[target], "lock");
+     return true;
+ }

Root cause#

The module treats the approve selector as sufficient authorization. The session lock is stored and never consulted. The spender in the calldata can be the session key itself.

Preconditions#

  • The wallet has enabled this session key.
  • The lock records 100 USDT and 1 WETH. It does not record USDC or WBTC.
  • The wallet holds 1,000 USDC, 100 USDT, 5 WETH, and 2 WBTC.

Attack walkthrough#

  1. The wallet is funded. USDC is outside the lock.
  2. The session key asks the wallet to approve USDC to itself.
  3. The module returns true on the approve selector.
  4. transferFrom pulls 1,000 USDC.
  5. The same approve is used for WBTC, and for the locked tokens, with no amount check.
  6. The session key holds the 1,000 USDC. Every wallet balance is 0.

Diagrams#

flowchart TD A["Session lock is 100 USDT and 1 WETH"] --> B["Wallet also holds 1000 USDC, WETH, and WBTC"] B --> C["Session key submits approve to itself"] C --> D["VULN selector check returns true"] D --> E["transferFrom pulls USDC, USDT, WETH, and WBTC"] E --> F["Session key holds 1000 USDC. Wallet balances are 0"]

Impact#

The wallet owner loses 1,000 USDC that the session was never allowed to touch, and also loses the locked USDT and WETH plus the extra WBTC. Checking that the spender is the module, and that the amount is inside the lock, stops the approval.

How to reproduce#

BASH
cd 62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n_exp
forge test -vv

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.