fix: ERC1155 safeBatchTransferFrom parser trusts unvalidated dynamic offsets and can spoof the review UI#1007
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1007 +/- ##
========================================
Coverage 56.10% 56.10%
========================================
Files 26 26
Lines 2417 2417
Branches 322 312 -10
========================================
Hits 1356 1356
+ Misses 1057 979 -78
- Partials 4 82 +78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…offsets and can spoof the review UI
60d6391 to
4ddcc8a
Compare
Contributor
|
elf sizes
Stack consumption summary (clone_app_stack_consumption)
Stack consumption summary
|
apaillier-ledger
approved these changes
May 11, 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
Automated security fix for ERC1155 safeBatchTransferFrom parser trusts unvalidated dynamic offsets and can spoof the review UI (High).
CWE: CWE-20
OWASP: A04:2021-Insecure Design
Fix Confidence: high
What Changed
Hardened the ERC1155 batch-transfer parser against spoofed calldata layouts. For both TOKEN_IDS_LENGTH and VALUE_LENGTH: if the current sequential
parameterOffsethas not yet reached the declared offset, keep waiting; if it has passed/does not match exactly, abort with ETH_PLUGIN_RESULT_ERROR. This prevents attacker-chosenids_offset/values_offsetvalues that point backwards, overlap, or are non-32-byte-aligned from being used to misinterpret an unrelated calldata word as the array length. Additionally, a mismatch betweenids[]andvalues[]lengths now aborts the transfer instead of merely logging, so the UI summary (context->value/context->array_index) can no longer be desynchronized from what the contract will execute.Caveats
Verification Checklist
Created by Cerberus Merlin