Skip to content

fix(enforcers): pin ExactCalldataBatchEnforcer terms target and value - #199

Open
SashaMIT wants to merge 1 commit into
MetaMask:mainfrom
SashaMIT:fix/exact-calldata-batch-pin-target-value
Open

fix(enforcers): pin ExactCalldataBatchEnforcer terms target and value#199
SashaMIT wants to merge 1 commit into
MetaMask:mainfrom
SashaMIT:fix/exact-calldata-batch-pin-target-value

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Closes #198. Sibling of #195 / #197.

ExactCalldataBatchEnforcer terms are encoded as Execution[] (target, value, calldata), but beforeHook only hashed calldata. A redeemer could reuse the same calldata against a different ERC-20 target (or attach native value) while the caveat still passed.

ExactExecutionBatchEnforcer already pins the full execution. Single-call ExactCalldataEnforcer correctly treats terms as raw calldata; the batch variant's terms ABI implies target/value must be checked too.

Fix

In the batch loop, require target and value equality with terms, then calldata (fail closed). NatSpec updated.

Testing

forge test --match-contract ExactCalldataBatch — 11/11 (includes target-swap + non-zero value regressions).

Made with Cursor

Terms are Execution[] but beforeHook only compared calldata, so a
redeemer could swap targets or attach ETH with identical calldata.
Enforce target and value as well; add regression tests.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
@SashaMIT
SashaMIT requested a review from a team as a code owner August 8, 2026 11:32
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.

ExactCalldataBatchEnforcer should pin terms target and value

1 participant