Skip to content

cdn/client/v1 receive loop: unbounded zero-length ChunkData frames spin without progress #1088

Closed

Description

@yigitdot

Spun out of the multi-agent review on #1085 (empty-blob bao delivery).

Problem

ChunkData has no minimum-length validation (crates/protocol/src/client.rs), so a peer can send an unbounded stream of zero-length ChunkData{ bytes: [] } frames before StreamEnd. In the client receive loops each empty frame leaves cumulative / bytes_since_voucher unchanged, so the overrun guard (cumulative > expected_wire) never trips and the loop makes no application-level progress:

  • receive_and_pay — crates/client-pull/src/lib.rs (buffered path)
  • UpstreamPull::next_chunk — crates/client-pull/src/lib.rs (progressive/window path)

The empty-blob change (#1054, expected_wire == 0) makes this trivially reachable with zero expected bytes, but it is pre-existing and applies to any blob size (a non-empty delivery can be padded with empty frames too).

Impact

Low. No integrity or payment impact — 0 bytes are billed, no vouchers are signed, and the content hash is still verified on exit. The loop is bounded only by QUIC idle/stream timeouts, not by application logic, so the worst case is a weak liveness/annoyance already backstopped by the transport.

Options

  • Reject zero-length ChunkData frames outright (they carry no payload), or
  • Cap the number of consecutive no-progress frames per stream.

Not blocking any current work; filed for tracking. Source refs: crates/client-pull/src/lib.rs (receive_and_pay, UpstreamPull::next_chunk), crates/protocol/src/client.rs (ChunkData).

Metadata

Metadata

Assignees

Labels

prio:medium

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions