Repository navigation
fix: validate ABI reads at each parameter head - #5572
Conversation
|
@yinbowen-dc is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 0ae4c8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Reproduced on 2.58.0 with the payload from the test ( I applied the one-line change to the published build to check it does not affect valid inputs: the malformed ox has the same guard in |
…e`, `Hex` and `PersonalMessage` (#729) - Kept a leading U+FEFF when decoding UTF-8 strings (wevm/viem#5590). - Rejected a missing static head after a dynamic parameter in AbiParameters.decode (wevm/viem#5572). - Rejected odd-length hex in PersonalMessage.encode (wevm/viem#5631). - Added blockAccessListHash and slotNumber to Block (wevm/viem#5674). - Added baseFeePerBlobGas and blobGasUsedRatio to Fee.FeeHistory (wevm/viem#5635). Amp-Thread-ID: https://ampcode.com/threads/T-01a21f59-905f-745c-8634-6581aa9f965e Co-authored-by: Amp <[email protected]>
…e`, `Hex` and `PersonalMessage` (#730) - Kept a leading U+FEFF when decoding UTF-8 strings (wevm/viem#5590). - Rejected a missing static head after a dynamic parameter in AbiParameters.decode (wevm/viem#5572). - Rejected odd-length hex in PersonalMessage.encode (wevm/viem#5631). - Added blockAccessListHash and slotNumber to Block (wevm/viem#5674). - Added baseFeePerBlobGas and blobGasUsedRatio to Fee.FeeHistory (wevm/viem#5635). Backport of #729. Amp-Thread-ID: https://ampcode.com/threads/T-01a21f59-905f-745c-8634-6581aa9f965e Co-authored-by: Amp <[email protected]>
Fixes #5566.
Always restore the cursor to the next ABI parameter head, including when the head is at the end of the data. Nonempty reads then enforce their own bounds, while zero-width arrays and tuples remain valid. A dynamic offset into an earlier word can no longer make a missing static head reuse that earlier word.
Validation: both string and bytes regression cases fail on main; all 85 decodeAbiParameters tests pass with the fix, including existing zero-width cases. Biome passed. Production TypeScript check passed earlier for the same base; full project types need generated test-contract artifacts. A patch changeset is included.
AI assistance: prepared and tested with Codex at the account owner's request.