Skip to content

client: with max_blob_bytes = 0 the planner sizes its work from an unsigned peer size claim #2843

Closed

Description

@altanoruc

Source: security review at b5e29ae (2026-11-05). Each claim below was re-read on disk by independent verifiers.

claim_reach (crates/client/src/scheduler.rs:244) returns u64::MAX when the cap is 0, so the first bound is the raw claim. The claim is either the unsigned probe hint ProbeResponseExt.total_bytes or the signed but unbounded StreamResponse.total_bytes.

Coverage and segment planning are linear in num_blocks(total_bytes). A scratch test measured about 130 B and 2.2 µs per 64 MiB block: a 2^50 claim took 36 s and 2.1 GiB before any byte was paid or verified.

num_blocks (crates/protocol/src/coverage.rs:85, :104) also truncates to u32. Its comment says ~256 EiB, but the limit is 256 PiB, so a claim of 2^58 or more wraps.

Exposure:

  • the SDK Downloader and Streamer default max_blob_bytes to 0 (downloader.rs:154, streamer.rs:465);
  • the CLI defaults to 1 TiB, so it is exposed only with --max-blob-mb 0, whose doc says "RAM stays bounded whatever the claim" (crates/common/src/cli/fetch.rs:210-212).

#1985 noted the billing side of cap 0; this is the planner side.

  • Give claim_reach a finite sizing ceiling when the cap is 0 (the bound already grows as bytes verify)
  • Make num_blocks saturate, and correct both doc comments
  • Test: a 2^57 claim with cap 0 plans in bounded memory

Activity

  1. added
    kind:security
    prio:medium
    area:client
    on Nov 5, 2026
  2. added theissue type on Nov 5, 2026
  3. moved this from Backlog to In progress in deCDNon Nov 11, 2026
  4. yigitdot commented on Nov 13, 2026

    @yigitdot
    Contributor

    Obsoleted by #2885: claim_reach and the unsigned-claim sizing path no longer exist — planning starts only from a verified ProvenSize, so no peer claim can size the planner's work at any cap. num_blocks saturates at u32::MAX (saturate_blocks in protocol/src/coverage.rs). All three checkboxes are done or moot.

  5. moved this from In progress to Done in deCDNon Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clientkind:securityprio:medium

    Type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions