← Lab /Security & privacy

Six common vulnerability patterns in ERC-4337 smart accounts

The six listed patterns are the most frequent vulnerabilities found in ERC-4337 smart accounts.

Security & privacy Trail of Bits 11 Mar 2026 Disclosure Theory

Published as “Six mistakes in ERC-4337 smart accounts”

Why it matters

Developers should apply the listed checks to avoid critical bugs that can lead to fund loss in ERC-4337 smart accounts.

Summary

The authors audited dozens of ERC-4337 smart accounts and identified six recurring vulnerability patterns: missing access control on execute functions, incomplete signature validation of gas fields, state writes during validation, ERC-1271 replay attacks, reliance on post-operation reverts for safety, and initialization races with ERC-7702. They explain each issue, show unsafe code snippets, and recommend concrete mitigations such as restricting execute to the EntryPoint, binding all gas fields to the signature, keeping validation stateless, using EIP-712 domain separation, making postOp non-reverting, and checking msg.sender during ERC-7702 initialization. The evidence is based on their internal audit experience rather than systematic measurement.

What they found 2

  1. Missing access control on execute functions allows anyone to drain the wallet.

    “If anyone can call your account’s execute function (or anything that moves funds) directly, they can do anything with your wallet.”

  2. Reverts after validateUserOp do not prevent the bundler from being paid, allowing fee draining.

    “In ERC-4337, once validateUserOp succeeds, the bundler gets paid regardless of whether execution later reverts.”

What’s new here 4

  • Identification of six recurring vulnerability patterns specific to ERC-4337 smart accounts.
  • Highlighting the need to bind all gas-related fields to the user operation signature.
  • Demonstrating that state modifications during validateUserOp can be overwritten in batch execution.
  • Describing ERC-1271 replay risks and the mitigation via EIP-712 domain separation.