From 72fc2040f9f33cf5c1ce6fb35e8972a3351b4427 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 27 Oct 2026 04:53:15 -0700 Subject: [PATCH 1/3] chore(quest): claim quest/m1/cut-audit/announce-path-bytes.md Quest-Claim: 114559d55d21c81b From 57d15f0eda5c95004138027ca569e5a66a9c839a Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 27 Oct 2026 05:03:41 -0700 Subject: [PATCH 2/3] test(net): prove compressed announce paths fit literal starts Co-Authored-By: GPT-6 --- quest/m1/cut-audit/README.md | 1 - quest/m1/cut-audit/announce-path-bytes.md | 43 ----------------------- quest/m1/cut-audit/announce-reencode.md | 4 --- rs/moq-net/fuzz/README.md | 2 +- rs/moq-net/src/fuzz.rs | 37 +++++++++++++++++++ 5 files changed, 38 insertions(+), 49 deletions(-) delete mode 100644 quest/m1/cut-audit/announce-path-bytes.md diff --git a/quest/m1/cut-audit/README.md b/quest/m1/cut-audit/README.md index 1ebd950c120..e345f55fcfb 100644 --- a/quest/m1/cut-audit/README.md +++ b/quest/m1/cut-audit/README.md @@ -55,7 +55,6 @@ leaving JS-only redesigns of `js/net` to [rs2ts](/quest/m2/rs2ts/README.md). ## Required - [Counted field-less `trun` entries](/quest/m1/cut-audit/fmp4-sample-resolver.md) - a moof of field-less runs cannot materialize millions of sample entries -- [A compressed announce path never outgrows its literal form](/quest/m1/cut-audit/announce-path-bytes.md) - lite-07 announce compression cannot build multi-MiB paths - [A route too large to re-encode is skipped](/quest/m1/cut-audit/announce-reencode.md) - one oversized route never resets a downstream announce stream - [A reserved group survives a route returning](/quest/m1/cut-audit/reserved-route-return.md) - a route flip A to B to A no longer panics a peeked reader - [JS tracks end clean only on a deliberate finish](/quest/m1/cut-audit/js-close-cause.md) - local close, violations, and unanswered requests end with errors diff --git a/quest/m1/cut-audit/announce-path-bytes.md b/quest/m1/cut-audit/announce-path-bytes.md deleted file mode 100644 index ef8a86615ad..00000000000 --- a/quest/m1/cut-audit/announce-path-bytes.md +++ /dev/null @@ -1,43 +0,0 @@ -# [S] A compressed announce path never outgrows its literal form - -## Goal - -A lite-07 ANNOUNCE_START whose base/keep compression resolves to a path -longer than one literal ANNOUNCE_START body could carry closes the session -with PROTOCOL_VIOLATION, in Rust and `@moq/net`. A peer can no longer turn a -12-byte message into a multi-MiB path that the decoder, the origin, and every -forwarded copy hold. - -## Plan - -Found by the 2026-10-24 pre-cut audit at -[151a529670](https://github.com/moq-dev/moq/commit/151a529670). Source-inferred, -inherited from release (worse there under its 64 MiB message cap). Reachable -only while `moq-lite-07-wip` is negotiated, which -[Finalize moq-lite-07](/quest/m1/lite07-finalize.md) turns on by default. - -`Live::resolve_path` (`rs/moq-net/src/lite/compress.rs:48`) bounds a -resolved suffix only by `Path::MAX_PARTS` (32). Thirty-two STARTs that each -keep the previous suffix and append a ~64 KiB segment build a ~2 MiB suffix; -every later START with `keep=31` copies it again for about 12 wire bytes, up -to `Limits::announces` times. `origin.rs` `create_withheld` (about line 2176) -claims a path it accepts "can be re-encoded when forwarded" but checks parts -only. JS `AnnounceHistory` (`js/net/src/lite/announce.ts:383`) has the same -parts-only check. - -- No new constant: the bound is the existing literal one. A resolved suffix, - and the prefix joined with it, must fit in a literal ANNOUNCE_START body - under `MAX_MESSAGE_SIZE`. Compression never expresses a path the literal - form could not. -- Enforce the same byte bound in `create_withheld`, so a locally created - route is never one this wire cannot forward. -- Extend the `announce_stream` fuzz target to assert every resolved path - encodes as a literal START. -- Add the receiver rule to `drafts/draft-lcurley-moq-lite.md` (lite-07 is - unpublished, so this changes no published version). - -Public API: none. Wire: one receiver rule in the lite-07 draft. - -## Related - -- [A route too large to re-encode is skipped](/quest/m1/cut-audit/announce-reencode.md) - the same size bound on the send side diff --git a/quest/m1/cut-audit/announce-reencode.md b/quest/m1/cut-audit/announce-reencode.md index 3fc30eb0720..c32b3970044 100644 --- a/quest/m1/cut-audit/announce-reencode.md +++ b/quest/m1/cut-audit/announce-reencode.md @@ -31,7 +31,3 @@ them. On lite-06+ the encoder has already spent an announce id. asserts the sibling routes still arrive. Public API: none. Wire: none. - -## Related - -- [A compressed announce path never outgrows its literal form](/quest/m1/cut-audit/announce-path-bytes.md) - the receive-side bound diff --git a/rs/moq-net/fuzz/README.md b/rs/moq-net/fuzz/README.md index 6c877b91a13..cc932e392e9 100644 --- a/rs/moq-net/fuzz/README.md +++ b/rs/moq-net/fuzz/README.md @@ -49,7 +49,7 @@ Beyond "does not panic": iteration order differs per instance (moq-lite SETUP, and draft-14/15, which unlike draft-16+ do not sort by key first). - A lite-07 announce stream our decoder accepts, recompressed by our encoder, resolves - to the same announcements. + to the same announcements, and every resolved path fits a literal ANNOUNCE\_START. - Setup Options a client accepts from its server, a server accepts from its client: only PATH and AUTHORITY are one-sided. - `Path::relative` inverts `Path::resolve`, and never produces a reference that walks diff --git a/rs/moq-net/src/fuzz.rs b/rs/moq-net/src/fuzz.rs index 37629185218..a6594322594 100644 --- a/rs/moq-net/src/fuzz.rs +++ b/rs/moq-net/src/fuzz.rs @@ -611,10 +611,28 @@ impl LiteSample { /// Feed a lite-07 announce stream through the stateful decoder, then check that our /// encoder's compression of what it resolved reads back as the same announcements. +/// Every resolved path must also fit an uncompressed ANNOUNCE_START at that version. /// /// Returns whether anything resolved. pub fn announce_stream(data: &[u8]) -> bool { let resolved = decode_announces(data, true); + let mut literal = Vec::new(); + for announced in &resolved { + if let Announced::Start(suffix, hops) = announced { + literal.clear(); + lite::AnnounceBroadcast::Active { + suffix: lite::PathRef::literal(suffix.clone()), + epoch: None, + hops: lite::HopsRef::literal(hops.clone()), + cost: Default::default(), + } + .encode( + &mut Encoder::new(&mut literal, lite::Version::Lite07.into()), + lite::Version::Lite07, + ) + .expect("a resolved path fits a literal ANNOUNCE_START"); + } + } let echo = decode_announces(&encode_announces(&resolved, true), true); assert_eq!(echo, resolved, "compression did not survive a round trip"); !resolved.is_empty() @@ -1301,6 +1319,25 @@ pub fn seeds() -> Vec { data: encode_announces(&announced, true), }); } + // A compressed join lands exactly on the UTF-8 byte limit, beside a full hop list. + let head = "a".repeat(Path::MAX_BYTES - "/é".len()); + let hops = Hops::try_from( + (0..crate::origin::HopLimit::default().get()) + .map(|n| hop((1 << 51) + n as u64)) + .collect::>(), + ) + .expect("a full valid hop list"); + seeds.push(Seed { + target: "announce", + kind: 0, + data: encode_announces( + &[ + Announced::Start(Path::new(&head).unwrap(), hops.clone()), + Announced::Start(Path::new(&format!("{head}/é")).unwrap(), hops), + ], + true, + ), + }); // One of each length tag in both codecs, plus the all-ones forms that only the // leading-ones codec accepts. From 9b7d2d6ef7b2291cea1f9ae55878450694075f1d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 27 Oct 2026 14:55:02 -0700 Subject: [PATCH 3/3] chore(quest): retire announce-path-bytes, finished by #6927 Resolved and joined paths are refused past Path::MAX_BYTES (now 4096) in Rust and @moq/net, the lite-07 draft carries the receiver rule, and a 4096-byte path with a full hop list always fits a literal ANNOUNCE_START. Co-Authored-By: Claude Opus 5.5 --- quest/m1/cut-audit/README.md | 1 - quest/m1/cut-audit/announce-path-bytes.md | 39 ----------------------- 2 files changed, 40 deletions(-) delete mode 100644 quest/m1/cut-audit/announce-path-bytes.md diff --git a/quest/m1/cut-audit/README.md b/quest/m1/cut-audit/README.md index 216371d071d..006fcca57cb 100644 --- a/quest/m1/cut-audit/README.md +++ b/quest/m1/cut-audit/README.md @@ -55,7 +55,6 @@ leaving JS-only redesigns of `js/net` to [rs2ts](/quest/m2/rs2ts/README.md). ## Required - [Counted field-less `trun` entries](/quest/m1/cut-audit/fmp4-sample-resolver.md) - a moof of field-less runs cannot materialize millions of sample entries -- [A compressed announce path never outgrows its literal form](/quest/m1/cut-audit/announce-path-bytes.md) - lite-07 announce compression cannot build multi-MiB paths - [A reserved group survives a route returning](/quest/m1/cut-audit/reserved-route-return.md) - a route flip A to B to A no longer panics a peeked reader - [JS tracks end clean only on a deliberate finish](/quest/m1/cut-audit/js-close-cause.md) - local close, violations, and unanswered requests end with errors - [Withdrawing a moq-transport FETCH or TRACK_STATUS ends it](/quest/m1/cut-audit/ietf-withdraw-resolve.md) - withdrawal during resolution releases the request diff --git a/quest/m1/cut-audit/announce-path-bytes.md b/quest/m1/cut-audit/announce-path-bytes.md deleted file mode 100644 index e917d253947..00000000000 --- a/quest/m1/cut-audit/announce-path-bytes.md +++ /dev/null @@ -1,39 +0,0 @@ -# [S] A compressed announce path never outgrows its literal form - -## Goal - -A lite-07 ANNOUNCE_START whose base/keep compression resolves to a path -longer than one literal ANNOUNCE_START body could carry closes the session -with PROTOCOL_VIOLATION, in Rust and `@moq/net`. A peer can no longer turn a -12-byte message into a multi-MiB path that the decoder, the origin, and every -forwarded copy hold. - -## Plan - -Found by the 2026-10-24 pre-cut audit at -[151a529670](https://github.com/moq-dev/moq/commit/151a529670). Source-inferred, -inherited from release (worse there under its 64 MiB message cap). Reachable -only while `moq-lite-07-wip` is negotiated, which -[Finalize moq-lite-07](/quest/m1/lite07-finalize.md) turns on by default. - -`Live::resolve_path` (`rs/moq-net/src/lite/compress.rs:48`) bounds a -resolved suffix only by `Path::MAX_PARTS` (32). Thirty-two STARTs that each -keep the previous suffix and append a ~64 KiB segment build a ~2 MiB suffix; -every later START with `keep=31` copies it again for about 12 wire bytes, up -to `Limits::announces` times. `origin.rs` `create_withheld` (about line 2176) -claims a path it accepts "can be re-encoded when forwarded" but checks parts -only. JS `AnnounceHistory` (`js/net/src/lite/announce.ts:383`) has the same -parts-only check. - -- No new constant: the bound is the existing literal one. A resolved suffix, - and the prefix joined with it, must fit in a literal ANNOUNCE_START body - under `MAX_MESSAGE_SIZE`. Compression never expresses a path the literal - form could not. -- Enforce the same byte bound in `create_withheld`, so a locally created - route is never one this wire cannot forward. -- Extend the `announce_stream` fuzz target to assert every resolved path - encodes as a literal START. -- Add the receiver rule to `drafts/draft-lcurley-moq-lite.md` (lite-07 is - unpublished, so this changes no published version). - -Public API: none. Wire: one receiver rule in the lite-07 draft.