0xMiden / 0xMiden/protocol

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

Abierto
#3,185 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
132
Forks
167
Merge medio
1 d 23 h
PR fusionados (30 d)
110

Descripción

### 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.
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.