Skip to content

fix: reject trailing invocation bytes - #1434

Open
ukint-vs wants to merge 1 commit into
masterfrom
fix/strict-invocation-decoding
Open

fix: reject trailing invocation bytes#1434
ukint-vs wants to merge 1 commit into
masterfrom
fix/strict-invocation-decoding

Conversation

@ukint-vs

Copy link
Copy Markdown
Member

Problem

decode_invocation_params decoded the expected SCALE parameters but did not require them to consume the full invocation payload. A valid parameter prefix followed by extra bytes was therefore accepted.

Fix

Use DecodeAll after validating the Sails header so invocation parameters must consume every remaining byte. Add regression coverage proving valid payloads still decode and trailing bytes are rejected.

Verification

  • cargo test -p sails (24 passed, 4 ignored)
  • cargo clippy -p sails --all-targets -- -D warnings

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.

1 participant