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.
Submitted by Agontuk, also found by 0xnija and zcai
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‑callthis.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()enforcesmsg.sender == entrypointand callsthis.isValidSignature()BaseAuth.isValidSignature()delegates tosignatureValidation()BaseAuth.signatureValidation()enforces caller binding and raisesInvalidStaticSignatureWrongCallerwhenaddr != 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.
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
- Configure a static signature bound to the entrypoint as the required caller.
- Build a UserOperation that uses the static-signature flag.
- Call validateUserOp from the entrypoint.
- 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.