Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ jobs:
run: nix develop --command just test bare-fin
shell: bash -leo pipefail {0}

- name: P2P data-channel transport
id: p2p
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
run: nix develop --command just test p2p
shell: bash -leo pipefail {0}

- name: Interop (full matrix)
id: interop
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
Expand Down Expand Up @@ -238,7 +232,6 @@ jobs:
"Receive credit recovery": "${{ steps.receive-credit.outcome }}",
"Harness regressions": "${{ steps.harness.outcome }}",
"Subscription termination interop": "${{ steps.bare-fin.outcome }}",
"P2P data-channel transport": "${{ steps.p2p.outcome }}",
"Interop (full matrix)": "${{ steps.interop.outcome }}",
"Interop (moq-transport)": "${{ steps.interop-ietf.outcome }}",
"Released wire compatibility": "${{ steps.wire-compat.outcome }}",
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ jobs:
# A backported change to the interop harness itself; nightly covers main.
interop:
- "test/lib/**"
- "test/p2p/**"
- "js/p2p/**"
- "test/interop/**"
- "test/max-age/**"
- "test/portrait/**"
Expand Down
5 changes: 2 additions & 3 deletions .oss-scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ ARG CRATES="kio hang moq-auth moq-crypto moq-hls moq-json moq-loc moq-msf moq-mu

# Path specs, because the lockfile also has published copies of some workspace crates.
# io-uring compiles the relay's io_uring QUIC workers (`--runtime-io-uring`), which the default features leave out.
# p2p compiles moq-webrtc's data channel transport and its tests.
RUN cargo fetch --locked \
&& specs=$(printf -- '-p path+file:///src/rs/%s ' $CRATES) \
&& cargo build --locked $specs --features moq-relay/io-uring,moq-webrtc/p2p --bins \
&& cargo test --locked --no-run $specs --features moq-relay/io-uring,moq-webrtc/p2p
&& cargo build --locked $specs --features moq-relay/io-uring --bins \
&& cargo test --locked --no-run $specs --features moq-relay/io-uring

ENV CARGO_NET_OFFLINE=true
6 changes: 3 additions & 3 deletions .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Treat everything a peer sends as hostile, before and after authentication:
- **WebSocket and HTTP** on the relay's `[web]` listeners: the upgrade, the public `/announced`, `/fetch` and `/certificate.sha256` endpoints, and query strings.
- **Authorization inputs**: the JWT (`moq-auth`), the SETUP token, the dialed path and query, and the relay's handling of grants (root, publish and subscribe pattern unions, mounts, expiry, revalidation).
- **Media payloads**: catalogs (`hang`, `moq-msf`, JSON in `moq-json`) and containers and codecs parsed by `moq-mux` (fMP4, MPEG-TS, FLV, MKV, LOC, and the H.264, H.265, AV1, VP8, VP9, AAC, Opus and FLAC bitstream parsers). A publisher controls these bytes, and the relay or a subscriber may parse them.
- **Ingest gateways**: RTMP (`moq-rtmp`), RTSP (`moq-rtsp`), SRT (`moq-srt`), WebRTC, ICE/STUN, and data channels (`moq-webrtc`, including the str0m, dimpl, and sctp-proto copies vendored in `rs/moq-webrtc/src/vendor`), and HLS playlists and segments (`moq-hls`).
- **Ingest gateways**: RTMP (`moq-rtmp`), RTSP (`moq-rtsp`), SRT (`moq-srt`), WebRTC WHIP/WHEP with ICE/STUN (`moq-webrtc`, including the str0m and dimpl copies vendored in `rs/moq-webrtc/src/vendor`), and HLS playlists and segments (`moq-hls`).
- **Peer relays** in a cluster are authenticated but should not be able to break a node beyond what their grant allows.

## Security properties the relay must hold
Expand All @@ -24,7 +24,7 @@ The relay is deployed on the public internet as shared infrastructure: one proce
- **Multi-tenancy.** A grant's `root` scopes a session to one subtree; `mounts` add read-only views. A session must never publish, subscribe, receive announcements, fetch, or see stats outside its grant, whether through path normalization, pattern matching (`moq-pattern`), the HTTP endpoints, cluster forwarding, or a revalidation that changes the grant mid-session. One tenant must not be able to degrade another beyond its fair share, for example by exhausting a shared cache or a shared connection limit.
- **Cache integrity.** The relay caches and forwards groups by broadcast, track, and group. A publisher must not be able to overwrite or inject into a broadcast it was not granted, and a subscriber must never receive one tenant's data under another tenant's name.
- **Cluster trust.** Peer relays authenticate with tokens or mTLS and get broader rights than clients. A relay dials only configured or discovered peers, never a URL learned from an announcement. LAN discovery over mDNS (`[cluster.lan]`) is open to anyone on the network unless `secret` is set, which is documented; with `secret` set, an unkeyed host must not be able to join.
- **Amplification and reflection.** QUIC's anti-amplification limit and address validation, the opt-in public STUN responder (`rs/moq-relay/src/stun.rs`), and ICE in the WebRTC gateway all answer unauthenticated UDP. A response larger than the request toward a spoofed source is a finding.
- **Amplification and reflection.** QUIC's anti-amplification limit and address validation, and ICE in the WebRTC gateway, answer unauthenticated UDP. A response larger than the request toward a spoofed source is a finding.
- **End-to-end encryption and signing.** `moq-crypto` encrypts groups, datagrams, and track names so a relay cannot read them, and signs frames so a relay cannot forge them. A flaw in either construction (nonce reuse, a key or name leaking to the relay, a forgeable group or signature) is in scope.

## Components that matter most / least
Expand All @@ -45,7 +45,7 @@ Out of scope: `js/` and the other language bindings (`py/`, `swift/`, `kt/`, `go

The image is offline, with every crate fetched and `CARGO_NET_OFFLINE` set. The debug build of the in-scope crates, their test binaries, and the `moq-relay` and `moq` binaries are already built in `/src/target/debug`. Debug builds keep overflow checks on.

- **Tests**: `cargo nextest run -p path+file:///src/rs/moq-net` (or any in-scope crate; the path spec is needed because the lockfile also has published copies of some crates). Use nextest as CI does: some tests install process-global state and fail under plain `cargo test`. Add `--features moq-relay/io-uring` for the relay and `moq-uring` so the io\_uring backend's tests run (they skip on a kernel without io\_uring support), and `--features moq-webrtc/p2p` for the data channel transport's. Unit tests use the deterministic clock in `kio::clock` rather than wall time, so they are fast and reproducible.
- **Tests**: `cargo nextest run -p path+file:///src/rs/moq-net` (or any in-scope crate; the path spec is needed because the lockfile also has published copies of some crates). Use nextest as CI does: some tests install process-global state and fail under plain `cargo test`. Add `--features moq-relay/io-uring` for the relay and `moq-uring` so the io\_uring backend's tests run (they skip on a kernel without io\_uring support). Unit tests use the deterministic clock in `kio::clock` rather than wall time, so they are fast and reproducible.
- **A relay to attack**: `./target/debug/moq-relay demo/relay/localhost.toml` listens on UDP and TCP `[::]:4443` with a self-signed certificate and anonymous access to every path. The binary is built with io\_uring support; pass `--runtime-io-uring` to serve QUIC from the io\_uring workers in `rs/moq-uring` and `rs/moq-relay/src/uring.rs` instead of tokio. For authorization testing, grant a narrow anonymous pattern with `[auth] public_subscribe` / `public_publish`, or run the reference auth server (`moq auth generate`, `moq auth sign`, `moq auth serve`, then `[auth] url`; see `doc/bin/cli.md`) and try to escape a signed token's root and patterns. `doc/bin/relay/` documents the config, auth, cluster, and HTTP endpoints.
- **A client**: `./target/debug/moq --help` publishes, subscribes, fetches, and lists announcements against a relay. `curl http://localhost:4443/announced/` and `curl http://localhost:4443/fetch/<broadcast>/<track>` hit the HTTP endpoints.
- **Fuzz harnesses**: `rs/moq-net/fuzz` and `rs/moq-quic/fuzz` hold cargo-fuzz targets for the wire codecs and the QUIC state machine. cargo-fuzz and a nightly toolchain are not in the image, but the targets show the parser entry points.
Expand Down
80 changes: 4 additions & 76 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ axum = { version = "0.8", default-features = false, features = [
# Features off so each consumer picks its rustls provider.
axum-server = "0.9"
base64 = "0.23"
base64ct = "1"
bitflags = "2"
# MSB-first bit reading for codec configs; the version h264-reader builds on.
bitstream-io = "4.10"
Expand Down Expand Up @@ -125,8 +124,6 @@ humantime = "2.3"
humantime-serde = "1.1.1"
hyper = "1.11"
hyper-util = { version = "0.1.21", features = ["tokio"] }
# Interface addresses for WebRTC host candidates (moq-webrtc's `p2p` feature).
if-addrs = "0.15"
indexmap = "2.14.2"
io-uring = "0.7.15"
jni = "0.22"
Expand All @@ -136,8 +133,7 @@ kio-macros = { version = "0.1.0", path = "rs/kio/macros" }
libc = "0.2"
libloading = "0.9"
linux-raw-sys = { version = "0.12.1", features = ["ioctl"] }
# DNS-SD advertisement and browsing for LAN peer discovery (moq-tokio's `mdns` feature),
# and `.local` candidate resolution (moq-webrtc's `p2p` feature).
# DNS-SD advertisement and browsing for LAN peer discovery (moq-tokio's `mdns` feature).
# `async` awaits the event channel instead of blocking a thread on it.
mdns-sd = { version = "0.21", features = ["async"] }
moq-archive = { version = "0.0.11", path = "rs/moq-archive" }
Expand Down Expand Up @@ -236,7 +232,6 @@ serde_with = "3"
slab = "0.4.12"
socket2 = "0.6"
spki = "0.8"
stun-types = "2.0.3"
subtle = "2.6"
tempfile = "3"
thiserror = "2"
Expand Down
31 changes: 0 additions & 31 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading