0xMiden / 0xMiden/protocol

bug: ProposedBlock::Deserializable skips all validation in read_from validation bypass via deserialization

Ouverte
#3,185 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
132
Forks
167
Merge moyen
1 j 23 h
PR mergées (30 j)
110

Description

### Packages versions

miden-protocol: next branch

### Bug description

ProposedBlock::read_from constructs the struct directly without calling new_at, so all validation is skipped during deserialization.

This is unlike ProposedBatch::read_from which correctly calls new_batch_inner.

Skipped checks: duplicate batches, timestamp monotonicity, batch expiration, chain consistency, NoteTracker (duplicate notes, circular deps, unauthenticated note auth), nullifier witnesses, account update consistency.

Impact: A corrupted/malicious serialized block passes deserialization and only fails later (or not at all), causing late failure and confusing errors.

### How can this be reproduced?

1. Serialize a valid ProposedBlock
2. Corrupt it (e.g., duplicate a batch ID)
3. Deserialize with read_from_bytes()
4. It succeeds validation skipped!
5. Only fails later when into_header_and_body() is called

ProposedBatch does this correctly by calling new_batch_inner in read_from. ProposedBlock should do the same with new_at.

### Relevant log output

```shell
No logs structural code issue.
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.