UserOperation Hijacking

UserOperation Hijacking is a security vulnerability in cross-chain account abstraction systems that use ERC-4337. This attack exploits the gap between when a user's cross-chain intent is registered and when it's executed.
Root Cause
The vulnerability exists because blockchain transactions are public and EntryPoint contracts accept UserOperations from any caller. The EntryPoint only verifies signature validity and nonce correctness without verifying that prerequisites (like asset availability) have been met. There is no authentication mechanism to ensure that only the designated filler can submit the UserOperation to the EntryPoint.
Attack Flow
User deposits funds on the origin chain, generating an event containing a
UserOperationThis
UserOperationincludes:The function to execute (e.g.,
order()on an NFT marketplace)nonceto prevent replay attackssignaturefor authorizing the execution
Before the legitimate filler can act, an attacker monitors the blockchain and extracts the
UserOperationThe attacker immediately submits this
UserOperationcallinghandleOps()on theEntryPointcontract.Since the
UserOperationcontains a valid signature, the EntryPoint processes it and consumes thenonce.When the legitimate filler later tries to execute the same
UserOperation, the transaction reverts because thenoncehas already been used
Mitigations
1. Account Validation
This approach involves implementing a custom validator module that maintains authorization mappings between UserOperation nonces and designated fillers.
This validator module should be installed on modular accounts to intercept and validate UserOperation execution attempts, ensuring only pre-authorized fillers can submit UserOperations through the validation layer.
2. Exclusive-relayer Contract Verification
A dedicated settlement contract approach involves deploying specialized contracts that maintain exclusive filler assignments for cross-chain intents. These contracts implement intent-hash to filler mapping with time-bounded exclusivity periods, requiring all UserOperation submissions to route through authorized settlement contracts that verify filler credentials.
Last updated