Skip to content

Reject Action Data With Bytes Left After the Arguments - #755

Merged
heifner merged 3 commits into
masterfrom
fix/reject-action-data-trailing-bytes
Nov 10, 2026
Merged

heifner merged 3 commits into
masterfrom
fix/reject-action-data-trailing-bytes

Conversation

@heifner

@heifner heifner commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

A native action's data must now hold exactly its struct. action::data_as fails with action_data_and_struct_mismatch when bytes are left over, which covers the native handlers and the authorization check of the permission actions.

  • The native structs declare the optional fields the system contract adds: memo on setcode and setabi, and authorized_by on updateauth, deleteauth, linkauth and unlinkauth. A new host binary_extension<T> encodes them as the CDT does, adding no bytes when absent.
  • Packed context-free data fails with tx_extra_data when bytes follow its list. No bytes and the packed empty list (00, which @wireio/sdk-core sends) are both still accepted.
  • sysio.wrap::exec reads the whole wrapped transaction and fails when it carries transaction extensions or bytes follow it.

Test contracts that read their action data raw declare an ignore<> parameter, and inline sends to actions without arguments carry no data.

Every system and test contract is rebuilt with the wire-cdt dispatcher from Wire-Network/wire-cdt#131, which fails an action whose data holds bytes after its arguments. No system contract ABI changes, so wire-libraries-ts needs nothing. The deep-mind log and the consensus blockchain data are regenerated; the snapshot compatibility fixture is unchanged and still passes.

Pairs with Wire-Network/wire-cdt#131. Merge them together. A release tag resolves the latest published wire-cdt release, so wire-cdt has to be released first.

A native action's data must hold exactly its struct: `action::data_as` fails with `action_data_and_struct_mismatch` when bytes are left over. The structs declare the optional fields the system contract adds, `memo` on `setcode` and `setabi` and `authorized_by` on `updateauth`, `deleteauth`, `linkauth` and `unlinkauth`, through a host `binary_extension` encoded as the CDT's.

Packed context-free data fails with `tx_extra_data` when bytes follow its list.

`sysio.wrap::exec` reads the whole wrapped transaction and fails when it carries transaction extensions or bytes follow it.

Every system and test contract is rebuilt with the wire-cdt dispatcher that fails an action whose data holds bytes after its arguments. No system contract ABI changes. The deep-mind log and the consensus blockchain data are regenerated.

Change-Id: I039b02881195e6b64c2a264eb94961ff74eb1145
huangminghuang
huangminghuang previously approved these changes Nov 9, 2026

@huangminghuang huangminghuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current diff and the native action, context-free-data, and wrap decoding paths. No actionable findings remain for the pre-launch scope.

Validation: focused base/head decoder probes, including valid optional extensions, and clangd checks. Full node and contract test suites were not run.

sysio.mechanics dispatches through SYSIO_DISPATCH, whose execute_action now checks only a contract's own actions, not the notifications routed through it.

Change-Id: I1e42948586c4370669dc634652bd1c2e3eecab16
huangminghuang
huangminghuang previously approved these changes Nov 9, 2026

@huangminghuang huangminghuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the current diff, including the sysmechanics WASM rebuild. No actionable findings for the pre-launch scope.

Validation: 14 direct WASM dispatcher cases across the previous and current artifacts passed, and the unchanged host-decoder probes were rerun. Full node and contract suites were not run locally.

The current-head Linux and macOS CI runs failed with GitHub Actions internal server errors before builds or tests started. Both complete workflows still need a successful rerun.

Every system and test contract is rebuilt with wire-cdt master. The deep-mind log and the consensus blockchain data are regenerated.

`propose_rejects_bytes_after_transaction` now authorizes `propose` with the proposer's `sysio.payer` permission, which master requires. It moves above the delayed-proposal comment, which belongs to `propose_approve_execute_with_delay`.

Change-Id: Ie4860c9dd1a4bdde6e88ea0d0222b5c16701d128

@huangminghuang huangminghuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current diff with OCR, including the master-merge resolution, removal of context-free actions, and multisig payer authorization. No actionable findings for the pre-launch scope.

Validation: fresh host-decoder probes and seven direct sysmechanics WASM dispatcher cases passed. The updated multisig regression tests compile. All 62 changed WASM modules validate and none import the removed context-free intrinsics. Clangd checks reported zero errors. Full node and contract suites were not run locally.

CI is still in progress: Ubuntu 24 completed its build and reached parallel tests; the other Linux and macOS builds are running.

@heifner
heifner merged commit 1775bd2 into master Nov 10, 2026
13 checks passed
heifner added a commit that referenced this pull request Nov 10, 2026
Brings in #755. sysio.roa and sysio.system WASM are rebuilt from the merged sources with wire-cdt master (4de22afa), and sysio.limitauth_tests keeps both new tests.
heifner added a commit that referenced this pull request Nov 10, 2026
sysio.synd and sysio.msgch are rebuilt with the wire-cdt master dispatcher that #755 adopted.
heifner added a commit that referenced this pull request Nov 10, 2026
Brings in the context-free action removal (#754), the action data trailing-bytes check (#755) and the msig propose payer (#751). sysio.token, sysio.liq and sysio.swap are rebuilt with wire-cdt master. Master's new transfer trailing-bytes test is kept, and open_tests stays removed.
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.

2 participants