fix(eip7702): onlySelf guard on BatchExecutor.multiSend - #56
Merged
Conversation
Without msg.sender == address(this), any third party can call a delegated EOA's multiSend and drain its ETH. Guard multiSend and refresh the embedded creation bytecode (solc 0.8.21, optimize 200).
keanji-x
approved these changes
Aug 18, 2026
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
BatchExecutor.multiSendhad no caller restriction. Under EIP-7702, any third party could call a delegated EOA and drain its ETH viaaddress(this).call{value:}.require(msg.sender == address(this), "only self")and refresh the embedded creation bytecode (solc 0.8.21 --optimize --optimize-runs 200).Context
Found while reviewing Gravity public testnet 7702 bench residual state: worker EOAs still delegated to the vulnerable template after the bench process stopped, leaving balances drainable. Testnet workers were cleared/swept separately; this PR hardens the contract for future deploys.
Self-sponsored bench txs (
tx.to == EOA,msg.sender == EOA) continue to work.Test plan
solc --bin --optimize --optimize-runs 200; embedded hex matches artifactCALLER ADDRESS EQ(333014) before multiSend bodymultiSendsucceeds; third-party call reverts"only self"