MetaMask / MetaMask/delegation-framework
ExactCalldataBatchEnforcer should pin terms target and value
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 226
- Forks
- 118
- Avg merge
- 1h 51m
- Merged PRs (30d)
- 1
Description
## Summary
`ExactCalldataBatchEnforcer` terms are encoded as `Execution[]` (target, value, calldata), but `beforeHook` only compares calldata. A redeemer can reuse the same calldata against a different `target` (or attach native `value`).
Sibling enforcer `ExactExecutionBatchEnforcer` already pins the full execution. Single-call `ExactCalldataEnforcer` correctly treats terms as raw calldata only; the batch variant's terms ABI implies the fuller check.
## Proposal
In the batch loop, also require `target` and `value` equality with the terms executions (fail closed), plus regression tests for target-swap and non-zero value.
Happy to open a PR against `main`.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating ExactCalldataBatchEnforcer and its beforeHook, then compare its batch-checking logic with ExactExecutionBatchEnforcer and the terms ABI described in the issue. Add regression coverage for swapping a target and for attaching a non-zero value, and run the existing Solidity test suite to confirm both cases fail closed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100