fix(cryptography): decode MultiSignerTRC7913 payload from calldata to avoid abi.decode reverts - #164
Merged
Merged
Conversation
… avoid abi.decode reverts Port of OpenZeppelin/openzeppelin-contracts#6642 (audit finding M-08), scheduled for openzeppelin-contracts v5.7 and not included in v5.6.1 (the base of this fork). `_rawSignatureValidation` used `abi.decode(signature, (bytes[], bytes[]))`, which reverts on malformed encoding. Decode the payload directly from calldata via a bounds-checked helper that returns `false` on malformed input, so account/paymaster validation can report an invalid signature instead of bubbling up a revert. The `_validateSignatures` and `_validateThreshold` override parameters change from `bytes[] memory` to `bytes[] calldata` (also updated in the `MultiSignerTRC7913Weighted` override). Compiles clean under solc 0.8.26 (the tron-solc frontend); the TVM MultiSignerTRC7913 suites run in CI.
luiz-lvj
force-pushed
the
fix/multisigner-trc7913-calldata-decode
branch
from
September 15, 2026 18:45
a033883 to
108e693
Compare
Collaborator
|
Upstream #6642 ships six tests for the malformed outer encoding paths (short buffer, offset past calldata, offset near |
Port upstream #6642's malformed outer-encoding cases as a minimal exposed harness (the upstream tests live in the account test file this fork omits). Verifies _rawSignatureValidation returns false instead of reverting on a short buffer, out-of-bounds offsets, and oversized array lengths.
Collaborator
Author
|
Added |
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
Ports OpenZeppelin/openzeppelin-contracts#6642 (audit finding M-08) from openzeppelin-contracts 5.7.
_rawSignatureValidationusedabi.decode(signature, (bytes[], bytes[])), which reverts on malformed encoding. Decode the payload directly from calldata via a bounds-checked helper that returnsfalseon malformed input, so account/paymaster validation can report an invalid signature instead of bubbling up a revert.The
_validateSignaturesand_validateThresholdoverride parameters change frombytes[] memorytobytes[] calldata(also updated in theMultiSignerTRC7913Weightedoverride).