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…
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
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.
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-registrymirror.
Vulnerability classes:
vuln/access-control/missing-auth
Key info#
| Field | Value |
|---|---|
| Loss | The 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 contract | CredibleAccountModule._validateSingleCall |
| Attacker EOA | 0x1111111111111111111111111111111111111111 (the session key owner) |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2025-10 |
| Compiler | solc 0.8.27, cancun |
| Bug class | approve 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#
bytes4 selector = bytes4(_callData);
if (selector == APPROVE) return true; // @> VULN: approve of any spender and any amount is allowed
- 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#
- The wallet is funded. USDC is outside the lock.
- The session key asks the wallet to approve USDC to itself.
- The module returns true on the approve selector.
transferFrompulls 1,000 USDC.- The same approve is used for WBTC, and for the locked tokens, with no amount check.
- The session key holds the 1,000 USDC. Every wallet balance is 0.
Diagrams#
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#
cd 62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n_exp
forge test -vv
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n.md
- Shieldify Etherspot review: https://github.com/shieldify-security/audits-portfolio-md/blob/main/Etherspot-GasTankPaymasterModule-Extended-Security-Review.md
_validateSingleCall: https://github.com/etherspot/etherspot-modular-accounts/blob/9019f2a78c36e74bdb1df4029672998cb4631162/src/modules/validators/CredibleAccountModule.sol#L763
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n_exp (evm-hack-registry mirror).
- AuditVault finding: 62847-c-01-sessionkey-owner-can-drain-the-smart-wallet-shieldify-n.
Alerts & third-party analyses
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.