A signature is only as narrow as the message it signs. If the signed message leaves out the target, the caller, a nonce or the action’s details, one genuine approval becomes a skeleton key.
Part 4 covered forged signatures that pass because nothing checks who signed. This guide covers the opposite problem: the signature is completely genuine, but the message it covers is far too broad.
The bug in one sentence
A value-moving function is gated by a signature over a digest that leaves out the target object, the caller, a nonce, a deadline or the domain, so one real authorization can be reused on other objects, by other callers, or many times over.
Cryptography tells you who signed. Only the digest tells you what they agreed to. ecrecover knows nothing about which contract called it, which chain it’s on, who submitted the transaction, or whether the same signature was used ten seconds ago. An authorization is only as specific as the fields inside its hash.
Two real cases
Atomic lending (Arbitrum, August 2026)
An unverified logic contract behind Atomic’s leveraged-trading proxy let an authorized manager trigger partial burns of Uniswap V3 positions. Reconstructed from the decompiled bytecode:
// selector 0xa806010f
function partialBurn(uint256 positionId, uint256 burnRatio, uint8 v, bytes32 r, bytes32 s) external {
bytes32 digest = keccak256(abi.encodePacked(burnRatio)); // no positionId, caller, nonce or chainId
address signer = ecrecover(digest, v, r, s);
require(signer == positionManager, "Unauthorized manager signature");
// no nonce is used up, no deadline is checked
_burnLiquidity(positionId, burnRatio); // burns whichever position the caller names
}
The manager signed a burnRatio, and that’s all. The digest didn’t include the position, the caller, the chain or a nonce. The attacker took one real manager signature from chain history and replayed it across 21 different positions in a single transaction. They combined that with a flash-loan price manipulation to turn the burns into profit.
Giddy Vault v3 (Ethereum, April 2026, about $1.3M)
Giddy did use EIP-712, with nonces and deadlines. It still lost about $1.3M, because the signed struct left out what the action actually did:
bytes memory dataArray;
for (uint256 i = 0; i < auth.compoundSwaps.length; ++i) {
dataArray = abi.encodePacked(dataArray, keccak256(auth.compoundSwaps[i].data)); // only .data is hashed
}
// ... digest built over nonce, deadline, amount and the hashed data, then the signer is checked
// later, when the swap runs:
SafeERC20.forceApprove(IERC20(swap.fromToken), swap.aggregator, swap.amount); // unsigned fields trusted
The keeper’s signature covered the nonce, the deadline and the hash of each swap’s data. It did not cover fromToken, toToken, amount or aggregator.
The attacker kept the signed data unchanged and swapped the unsigned fields: aggregator became the attacker’s contract, amount became the maximum, and fromToken became the vault’s gauge receipt token. The strategy approved the attacker for the vault’s whole balance.
EIP-712 isn’t automatically safe. A struct that leaves out the action’s details is as dangerous as a raw abi.encodePacked hash.
The blast radius
Each field missing from the digest multiplies how far one signature reaches:
- No target ID: the signature works on every object the contract manages.
- No caller binding: anyone can submit it.
- No nonce: it can be used any number of times.
- No deadline: it never expires.
- No domain (
chainIdplus contract address): it works on other chains and contracts. - No action details: the submitter can change what it does.
At Atomic, one signature became 21 burns because 21 positions sat under the same logic.
The attack, step by step (Atomic)
- Read the digest. Decompile or read the code, find the
ecrecover, and work out exactly what’s hashed. Here: no position, no nonce, no deadline. - Capture a signature. Pull a legitimate manager’s
(v, r, s)from the mempool or chain history. - Set up the profit. Flash-borrow and skew the spot price the protocol uses for valuation.
- Replay. In one transaction, call
partialBurn(positionId_i, burnRatio, v, r, s)for each position. Every call verifies. - Settle. Withdraw the unwound collateral, swap back, repay the flash loan and keep the profit.
Why it worked: three facts
- Signature-gated action. A value-moving function checks only the recovered signer.
- Underbound digest. The hashed message drops what makes an authorization unique: ID, caller, nonce or action.
- Replayable scope. There are multiple targets or repeat uses within reach.
Remove any one: require a caller role or multisig, bind the position and use up a nonce, or give each position its own signer.
How to hunt for it
- Find every recovery site.
bash grep -rnE "ecrecover\(|ECDSA\.recover\(|SignatureChecker|_validateAuthorization\(" src/ - Rebuild the exact digest. Compare every hashed field against this list: target ID, caller or submitter, token, amount, recipient, nonce, deadline,
chainIdand verifying contract. Flag anything missing. - Check the nonce is actually used up. Look for a storage write on the execution path, such as
nonces[signer]++orused[hash] = true. Reading a nonce without writing it protects nothing. - Check caller binding. Can anyone submit the signature? If so, does the digest at least bind the beneficiary?
- Check action details versus payload. In meta-transactions and compounders, does the signature cover the real transfers, approvals and recipients, or just an opaque blob?
Lookalikes that are safe, and why
- EIP-2612 permit (OpenZeppelin
ERC20Permit). It hashes owner, spender, value, an incrementing nonce and a deadline, under a domain separator that includeschainIdand the contract address. The nonce changes on every use, the deadline limits validity and the domain stops cross-chain reuse. - Uniswap Permit2. Signatures are single-use through bitmap or sequential nonces. A replay reverts with
InvalidNonce(). - Leaving out fields with no effect. Leaving out a memo, a display label or an analytics tag doesn’t widen what the signature can do.
Fixes that work
- Use an EIP-712 domain separator. Bind
block.chainidandaddress(this), and recompute it if the chain ID changes, to survive forks. - Sign every parameter that’s executed. Every argument the operation uses (
positionId,token,amount,recipient,aggregator) belongs in the typed struct. Never hash a generic blob while leaving the meaningful arguments free. - Use up nonces. Mark a sequential or bitmap nonce in storage atomically, so resubmitting reverts.
- Use short deadlines and bind the caller. Require
block.timestamp <= deadlinewith a narrow window, and hashmsg.senderinto the digest where you can, so nobody else can front-run or replay it.
The same bug in other clothes
- Atomic lending: missing position and nonce. Covered above.
- Giddy Vault v3: missing action parameters. Covered above.
- Cross-chain replay (illustrative example). A bridge that verifies validator signatures over
keccak256(abi.encodePacked(recipient, amount)), with nochainIdor contract address, lets an honest claim on one chain be replayed on every other chain it’s deployed to. - Reusable vouchers (illustrative example). A sale that accepts server signatures over
(buyer, discount)and never records used signatures lets one buyer redeem the same voucher again and again.
The last two are generic examples of the shape, not specific incidents.
Test yourself
- At Atomic, the manager’s signature was real. Why is this a bug and not a key compromise? The manager meant to authorize one burn. The contract didn’t bind the signature to that position or use up a nonce. No key was stolen. The digest design made one signature valid for 21 positions.
- A contract uses EIP-712 with a domain separator, nonce and deadline. Can it still have this bug? Yes. Giddy did. If the struct leaves out action parameters such as spender, token or amount, they can be swapped freely.
- How does this differ from part 4 (missing owner check)? Part 4 is about attribution: forged signatures pass because nobody compares the signer. This one is about scope: the signer is right, but the message is too broad.
- Why is
abi.encodePackedrisky for signed hashes? It doesn’t delimit dynamic types, soabi.encodePacked("a", "bc")equalsabi.encodePacked("ab", "c"). Fields can shift between parameters. Useabi.encodeor EIP-712. - How do you prove it quickly? In Foundry, sign an authorization for object A, then submit the same signature for object B or from another account. If it succeeds, you’ve shown the replay.
Recap
- A signature proves who signed. Only the digest defines what was agreed to.
- Six things make an authorization unique: target ID, caller, action details, a used-up nonce, a deadline, and the domain (
chainIdplus contract). - Atomic lost 21 positions to one signature. Giddy lost about $1.3M because its EIP-712 struct left out the swap target and amount.
- The standard: full EIP-712 typing over every executed argument, with a used-up nonce, a tight deadline and a proper domain.