Unsigned validity window metadata
The signature validation in AtomWallet extracts validUntil and validAfter from the trailing bytes of the signature but does not include them in the signed hash. An attacker can alter these time-window values without invalidating the signature, allowing them to extend or remove the validity period of a signed user operation.
v12 Follow with 0x1h3r, 0xbrett8571 and 45 others
Originally disclosed on Code4rena
This was found by V12 and selected as the primary submission.
Submitted by v12, also found by 0x1h3r, 0xbrett8571, 0xgreazy, 0xPhantomSec, 0xpiken, 0xUnderflow, adriro, akleeko22, Akshay1012, ameng, Antigone4224, archi_upside, assafhh, astaraudit, atilla055, binbin2803, choguun168, cryptoflops, Dinadash, Dinesh11G, dipanshuchhanikar, Hakeem_is_here, happykilling, HawkShadows25, jhongamersx, Josh4324, kimnoic, konstanis, meshaqRapha, MinionTechs, Ni9htNi9ht, Olami978355, Owen_smart, oxp_tr125, qwer, raz-uh, retroactivized, rishiRich, silverologist, valicera, Volleyking, w3bster, WhiteKnightK, XDZIBECX, Yoh, yol, and Zbugs
protocol/wallet/AtomWallet.sol#L285
Targets
_validateSignature(AtomWallet)
Affected Locations
- AtomWallet._validateSignature: Single finding location
Description
The signature validation path extracts validUntil and validAfter from the trailing 12 bytes of userOp.signature, but the recovered signer is computed only over userOpHash with an EIP‑191 prefix. Because the hash does not include the time‑window metadata, those values are not authenticated by the signer. Any relayer can alter the appended validity window while keeping the same 65‑byte ECDSA signature, and the recovered address will still match owner(). This defeats the intended time‑based restrictions and makes signature validity windows effectively attacker‑controlled.
Root cause
The validUntil/validAfter metadata is appended to the signature but never incorporated into the hashed message that is signed and recovered, so it is not cryptographically bound to the signer.
Impact
An attacker observing a signed user operation can extend or remove its validity window and resubmit it later, even if the signer intended it to expire quickly or become valid only after a certain time. This enables execution of operations outside the signer’s intended timeframe, potentially causing unwanted transfers or actions after the user believed the request had expired.
Proof of Concept
View Detailed Proof of Concept
Remediation
Status: Complete
Explanation
Bind validUntil and validAfter to the signed payload by hashing them with userOpHash when the signature includes the validity suffix, preventing relayers from altering the window without invalidating the signature.
Patch
diff --git a/src/protocol/wallet/AtomWallet.sol b/src/protocol/wallet/AtomWallet.sol
--- a/src/protocol/wallet/AtomWallet.sol
+++ b/src/protocol/wallet/AtomWallet.sol
@@ -294,7 +294,11 @@
(uint48 validUntil, uint48 validAfter, bytes memory signature) =
_extractValidUntilAndValidAfterFromSignature(userOp.signature);
- bytes32 hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", userOpHash));
+ bytes32 signedHash = userOpHash;
+ if (userOp.signature.length == 77) {
+ signedHash = keccak256(abi.encodePacked(userOpHash, validUntil, validAfter));
+ }
+ bytes32 hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", signedHash));
(address recovered, ECDSA.RecoverError recoverError, bytes32 errorArg) = ECDSA.tryRecover(hash, signature);
- Update
AtomWalletsignature parsing/validation to treat malformed/invalid signatures as validation failures rather than reverting.- For 77-byte signatures, sign and verify a digest that commits to
(userOpHash, validUntil, validAfter)before applying the EIP-191 prefix.- Add/adjust unit tests to cover malformed signatures, invalid
svalues, legacy 77-byte format, and metadata tampering.
Status: Mitigation confirmed. Full details in reports from gesha17, jerry0422, and 0xastronatey.
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
The validUntil and validAfter metadata are appended to the signature but not included in the hashed message that is signed, so they are not cryptographically bound to the signer.
Impact
An attacker who sees a signed user operation can extend or remove its validity window and resubmit it later, potentially causing unwanted transfers or actions after the user believed the request had expired.
What the attacker needed
Attacker can observe a signed user operation; attacker can submit transactions (relayer)
The fix
The issue was fixed by hashing validUntil and validAfter together with userOpHash when the signature includes the validity suffix, so any change to the window invalidates the signature.
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 checks signatures to approve actions. The signature includes extra data saying when it is valid, but that data is not actually covered by the signature. So anyone can change the dates and the signature still looks valid, letting them use the signed action at a different time than intended.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.