Skip to content
DoS Audit finding Intermediate

Static signatures bound to caller revert under ERC-4337, causing DoS

Static signatures bound to a specific caller (such as the ERC-4337 entrypoint) always fail validation because an external self-call changes the observed caller to the wallet itself. This causes valid UserOperations to revert, creating a denial-of-service vector.

Agontuk Follow with 0xnija and zcai

Originally disclosed on Code4rena

Submitted by Agontuk, also found by 0xnija and zcai

https://github.com/code-423n4/2025-10-sequence/blob/ccc328beeadd28fdbde53b034098c865104fcaf3/src/modules/ERC4337v07.sol#L30-L54

https://github.com/code-423n4/2025-10-sequence/blob/ccc328beeadd28fdbde53b034098c865104fcaf3/src/modules/auth/BaseAuth.sol#L81-L118

Finding description

Sequence wallets support ERC‑4337 by validating signatures inside validateUserOp() in ERC4337v07. The function enforces that msg.sender is the entrypoint and then performs signature verification via an external self‑call: this.isValidSignature(userOpHash, userOp.signature). Because of this external call, the msg.sender observed inside isValidSignature() (implemented in BaseAuth) becomes the wallet itself, not the entrypoint. As a result, the static signature validation in BaseAuth.signatureValidation()—which enforces a caller binding—fails whenever a non‑zero “expected caller” is set to the entrypoint.

In particular, BaseAuth.signatureValidation() checks the static signature’s bound caller using: “msg.sender inside isValidSignature() is the wallet itself, not the EntryPoint”, effectively comparing the configured caller addr to the wallet address instead of to the entrypoint.

The code path is:

ERC4337v07.validateUserOp() → external self‑call this.isValidSignature() → BaseAuth.isValidSignature() → BaseAuth.signatureValidation().

Inside signatureValidation(), the wrong caller check is: addr != address(0) && addr != msg.sender, and with a static signature bound to entrypoint, this condition triggers BaseAuth.InvalidStaticSignatureWrongCaller.

Root cause: the use of an external self‑call (this.isValidSignature(...)) in validateUserOp() changes the call context such that msg.sender inside the signature check becomes the wallet contract rather than the entrypoint. Static signatures that are intentionally bound to a specific caller (e.g., the entrypoint) will always fail under ERC‑4337 because the caller comparison is performed against the wallet.

Highest‑impact scenario: any ERC‑4337 flow that relies on static signatures with a non‑zero “expected caller” (for example, binding approval to the entrypoint) will systematically revert with BaseAuth.InvalidStaticSignatureWrongCaller, denying valid UserOperations and creating a denial‑of‑service vector. Additionally, because validateUserOp() does not handle reverts from isValidSignature(), invalid static signatures cause a revert instead of returning 0x00000000, violating ERC‑1271 expectations and amplifying the DoS impact.

All relevant names and logic:

  • ERC4337v07.validateUserOp() enforces msg.sender == entrypoint and calls this.isValidSignature()
  • BaseAuth.isValidSignature() delegates to signatureValidation()
  • BaseAuth.signatureValidation() enforces caller binding and raises InvalidStaticSignatureWrongCaller when addr != address(0) && addr != msg.sender

Impact

Medium. The issue breaks a supported signature mode (static signatures with bound caller) for ERC‑4337 flows, preventing valid operations and enabling DoS when such approvals are required. It does not compromise signature forgery or funds directly, but it blocks operations that depend on caller‑bound static signatures and causes systemic failures in those paths.

Likelihood

High. The behavior is deterministic whenever static signatures bind to a non‑zero caller (commonly the entrypoint) under ERC‑4337. Many real configurations use static signatures for approvals and policy enforcement, so the mismatch will be encountered in practice. When present, it triggers on every validateUserOp() that relies on these signatures.

Recommended mitigation steps

Avoid the external self‑call and explicitly propagate the intended caller into signature validation so that static signatures bound to the entrypoint succeed under ERC‑4337.

Proof of Concept

Add the test into test/modules/ERC4337v07.t.sol. After adding test_validateUserOp_staticSig_callerMismatch_reverts, import BaseAuth module.

Before running the test run a server using the following command:

cd ../sequence.js
pnpm build:packages
pnpm dev:server

Then run the test by,

forge test --mt test_validateUserOp_staticSig_callerMismatch_reverts

Import this:

+ import { BaseAuth } from "../../src/modules/auth/BaseAuth.sol";

PoC test:

  // PoC: Static signature with required caller is unusable under ERC-4337
  // Because validateUserOp calls `this.isValidSignature`, msg.sender inside
  // BaseAuth.signatureValidation is the wallet, not the EntryPoint.
  function test_validateUserOp_staticSig_callerMismatch_reverts(
    bytes32 userOpHash
  ) public {
    // Prepare the digest payload and compute opHash in the wallet domain
    Payload.Decoded memory payload;
    payload.kind = Payload.KIND_DIGEST;
    payload.digest = userOpHash;
    bytes32 opHash = Payload.hashFor(payload, wallet);

    // Configure a static signature bound to the EntryPoint as required caller
    vm.prank(wallet);
    Stage1Module(wallet).setStaticSignature(opHash, address(entryPoint), uint96(block.timestamp + 1 days));

    // Build a userOp that uses the static-signature flag (0x80)
    PackedUserOperation memory userOp = _createUserOp(bytes(""), hex"80");

    // Under ERC-4337, isValidSignature is called via `this`, so msg.sender == wallet.
    // Expect a WrongCaller revert: expected EntryPoint, got wallet.
    vm.prank(address(entryPoint));
    vm.expectRevert(
      abi.encodeWithSelector(
        BaseAuth.InvalidStaticSignatureWrongCaller.selector,
        opHash,
        address(wallet),
        address(entryPoint)
      )
    );
    Stage1Module(wallet).validateUserOp(userOp, userOpHash, 0);
  }

The test demonstrates the mismatch and resulting revert in the ERC‑4337 path by binding a static signature to the entrypoint and attempting to validate a UserOperation. It uses the repository’s existing patterns in test/modules/ERC4337v07.t.sol.


The original report as published on Code4rena, by Agontuk. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the external self-call in validateUserOp changes msg.sender inside the signature check to the wallet contract, so caller-bound static signatures never match the intended entrypoint.

Impact

Valid UserOperations that rely on caller-bound static signatures systematically revert, causing a denial of service; the issue does not directly compromise funds or allow signature forgery.

What the attacker needed

ERC-4337 wallet using static signatures; static signature bound to a non-zero caller; caller is typically the entrypoint

The fix

Avoid the external self-call and explicitly pass the intended caller into signature validation so that static signatures bound to the entrypoint succeed.

How it was found

  1. Configure a static signature bound to the entrypoint as the required caller.
  2. Build a UserOperation that uses the static-signature flag.
  3. Call validateUserOp from the entrypoint.
  4. Observe the revert with InvalidStaticSignatureWrongCaller because the wallet is seen as the caller.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract wallet can check signatures in two ways: by calling itself or by being called by another contract. Here, the wallet calls itself to check a signature, so the signature check sees the wallet as the caller instead of the original entrypoint. If the signature was locked to only work when the entrypoint calls, it now fails every time, blocking legitimate transactions.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Agontuk

View all

3 more disclosed reports, best first.

More from Sequence

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.