Killua
← All parts Bug Hunting Field Guide · Part 6 of 8

Signature replay: the skeleton-key digest

Killua · 7 min read

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:

At Atomic, one signature became 21 burns because 21 positions sat under the same logic.

The attack, step by step (Atomic)

  1. 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.
  2. Capture a signature. Pull a legitimate manager’s (v, r, s) from the mempool or chain history.
  3. Set up the profit. Flash-borrow and skew the spot price the protocol uses for valuation.
  4. Replay. In one transaction, call partialBurn(positionId_i, burnRatio, v, r, s) for each position. Every call verifies.
  5. Settle. Withdraw the unwound collateral, swap back, repay the flash loan and keep the profit.

Why it worked: three facts

  1. Signature-gated action. A value-moving function checks only the recovered signer.
  2. Underbound digest. The hashed message drops what makes an authorization unique: ID, caller, nonce or action.
  3. 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

Lookalikes that are safe, and why

Fixes that work

The same bug in other clothes

The last two are generic examples of the shape, not specific incidents.

Test yourself

  1. 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.
  2. 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.
  3. 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.
  4. Why is abi.encodePacked risky for signed hashes? It doesn’t delimit dynamic types, so abi.encodePacked("a", "bc") equals abi.encodePacked("ab", "c"). Fields can shift between parameters. Use abi.encode or EIP-712.
  5. 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