Skip to content

fix(counterfactual): consume signedWithdrawToUser EIP-712 digests - #1517

Open
SashaMIT wants to merge 1 commit into
across-protocol:masterfrom
SashaMIT:fix/admin-withdraw-signed-replay-guard
Open

fix(counterfactual): consume signedWithdrawToUser EIP-712 digests#1517
SashaMIT wants to merge 1 commit into
across-protocol:masterfrom
SashaMIT:fix/admin-withdraw-signed-replay-guard

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • AdminWithdrawManager.signedWithdrawToUser verified deadline + signer recovery but never consumed the authorization.
  • The same EIP-712 signature could therefore be replayed against a re-funded counterfactual deposit clone until deadline.
  • This PR records usedSignatures[digest] = true after recovery and before the external execute call, and reverts with SignatureAlreadyUsed on reuse. TYPEHASH is unchanged (one-shot digests; new withdrawals use a new deadline).

Impact if unsolved

Anyone holding a valid signed-withdraw authorization (or observing one on-chain) can drain subsequent deposits to the same clone for the same (token, amount) while the deadline remains open. Recipient stays forced to the leaf user, so this is repeated user payout / grief of re-deposited funds rather than theft to an attacker address, but it breaks the one-authorization-one-use expectation of a deadline-bound signed withdraw.

Test plan

  • New testSignedWithdrawToUserReplayAfterRefund: drain → re-fund → same sig reverts SignatureAlreadyUsed.
  • AdminWithdrawManagerTest 11/11 pass (forge test --match-contract AdminWithdrawManagerTest).

Reported via Elacity CodeRED Amber review.

Made with Cursor

signedWithdrawToUser checked deadline and signer recovery but never
marked an authorization as used, so the same signature could drain a
re-funded counterfactual clone until the deadline. Record the digest
before the external execute call.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant