fix(counterfactual): consume signedWithdrawToUser EIP-712 digests - #1517
Open
SashaMIT wants to merge 1 commit into
Open
fix(counterfactual): consume signedWithdrawToUser EIP-712 digests#1517SashaMIT wants to merge 1 commit into
SashaMIT wants to merge 1 commit into
Conversation
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>
SashaMIT
requested review from
bmzig,
mrice32,
nicholaspai and
pxrl
as code owners
August 8, 2026 04:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AdminWithdrawManager.signedWithdrawToUserverified deadline + signer recovery but never consumed the authorization.deadline.usedSignatures[digest] = trueafter recovery and before the externalexecutecall, and reverts withSignatureAlreadyUsedon 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 leafuser, 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
testSignedWithdrawToUserReplayAfterRefund: drain → re-fund → same sig revertsSignatureAlreadyUsed.AdminWithdrawManagerTest11/11 pass (forge test --match-contract AdminWithdrawManagerTest).Reported via Elacity CodeRED Amber review.
Made with Cursor