Skip to content

Reject trailing bytes in block proof payloads - #2459

Draft
quby1845 wants to merge 1 commit into
0xMiden:nextfrom
quby1845:harden-block-proof-decoding
Draft

Reject trailing bytes in block proof payloads#2459
quby1845 wants to merge 1 commit into
0xMiden:nextfrom
quby1845:harden-block-proof-decoding

Conversation

@quby1845

@quby1845 quby1845 commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • decode block-proof payloads through a reader with an explicit byte budget
  • reject bytes trailing the canonical BlockProof encoding
  • add regression coverage for canonical and suffixed proof payloads

Motivation

Deserializable::read_from_bytes intentionally permits trailing input. In the proof writer this
means a canonical BlockProof followed by arbitrary bytes can pass deserialization and the entire
payload can then be persisted and re-broadcast.

This change makes decoding exact: it parses a proof within the supplied payload budget and verifies
that the reader is exhausted before the proof is accepted.

Scope

This is an interim hardening change, not cryptographic block-proof verification. BlockProof is
currently a placeholder in miden-protocol, and the protocol does not yet expose the proof data,
public inputs, prover output, and verifier API required to implement the full fix described in
#2383. The existing verification TODO remains, with that dependency documented in the code.

Testing

  • canonical BlockProof encodings are accepted
  • a canonical encoding followed by arbitrary bytes is rejected

Refs #2383.

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