Reproduced Exploit

CredibleAccountModule — validateUserOp clears live on a memory copy

validateUserOp is supposed to retire a session by setting live to false. It loads SessionData into memory, so the write never reaches storage. The module still treats the session as live, the same way _isSessionKeyExpired and getLiveSessionKeysForWallet do, and pull transfers the locked 1000 to the…

Jun 2025•Other•logic•3 min read

Chain

Other

Category

logic

Date

Jun 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: 61406-c-04-memory-vs-storage-mismatch-renders-session-state-update. Standalone Foundry PoC and full write-up: 61406-c-04-memory-vs-storage-mismatch-renders-session-state-update_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/state-update · vuln/access-control/broken-logic

Key info#

ProtocolEtherspot CredibleAccountModule
FindingShieldify C-04, AuditVault 61406
Vulnerable codevalidateUserOp loads SessionData memory
HarmThe session key pulls 1000 after validation. The storage-pointer control blocks the pull.
Chainlocal synthetic

TL;DR#

validateUserOp is supposed to retire a session by setting live to false. It loads SessionData into memory, so the write never reaches storage. The module still treats the session as live, the same way _isSessionKeyExpired and getLiveSessionKeysForWallet do, and pull transfers the locked 1000 to the session key. Loading the struct as storage clears live, and the second pull reverts.

The vulnerable code#

SOLIDITY
SessionData memory sd = sessionData[sessionKeySigner][msg.sender];
sd.live = false;

The report's fix is SessionData storage sd.

Root cause#

A memory copy of a storage struct does not alias the slot. Assigning sd.live updates the copy. Every later read of sessionData[...][...].live still sees true.

Preconditions#

The wallet has enabled the session key with live true and 1000 tokens locked in the module. pull transfers that locked amount only while storage live is true. The wallet calls validateUserOp before the pull.

Attack walkthrough#

  1. The wallet calls validateUserOp for the session key.
  2. The function copies SessionData into memory and sets live false on that copy.
  3. A storage read after the call still returns live == true.
  4. pull sees live, transfers 1000 to the key, and the key's balance increases by 1000.
  5. The control module uses a storage pointer. After validation, live is false, pull reverts, and the 1000 stays in the module.

Diagrams#

flowchart TD A["Session is live with 1000 locked"] --> B["validateUserOp loads memory"] B --> C["VULN: live write misses storage"] C --> D["pull transfers 1000 to the key"] D --> E["Storage pointer blocks the pull"]

Impact#

A session that validation was supposed to retire can still move its locked balance. The key receives 1000. The control path leaves that 1000 in the module.

Remediation#

Declare sd as SessionData storage before assigning sd.live = false.

How to reproduce#

BASH
cd 61406-c-04-memory-vs-storage-mismatch-renders-session-state-update_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.