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
2 changes: 1 addition & 1 deletion .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Treat everything a peer sends as hostile, before and after authentication:
The relay is deployed on the public internet as shared infrastructure: one process serves many unrelated tenants, most of them anonymous or holding a token from a third party's auth server. Attack these properties:

- **Untrusted network input, bounded cost.** Whatever a peer sends, the memory, CPU, and state it makes the other side hold must be bounded. A peer that can grow relay memory or CPU without bound, past the configured per-session limits (`rs/moq-relay/src/limits.rs`), is a bug even when it takes many messages to do. Fan-out is the multiplier to look for: one publisher's bytes, or one subscriber's request, reaching many sessions or pinning cache.
- **Encryption.** Every transport is TLS 1.3 via rustls with aws-lc: QUIC and WebTransport, and WebSocket over `[web.https]`. Certificates are loaded from disk or self-signed and pinned by the fingerprint at `/certificate.sha256`. Check whether the relay accepts 0-RTT, and if it does, whether early data can be replayed. Plain `[web.http]` is a documented development option, not a finding.
- **Encryption.** Every transport is TLS 1.3 via rustls with rind: QUIC and WebTransport, and WebSocket over `[web.https]`. Certificates are loaded from disk or self-signed and pinned by the fingerprint at `/certificate.sha256`. Check whether the relay accepts 0-RTT, and if it does, whether early data can be replayed. Plain `[web.http]` is a documented development option, not a finding.
- **Authentication.** Sessions are admitted by a JWT (`moq-auth`, which accepts HMAC, RSA, ECDSA and EdDSA keys, so algorithm confusion and key selection are in scope), by an external auth server over HTTP (`doc/bin/relay/auth.md`), by a verified client certificate weighed by that server, or by a static anonymous grant. Expiry, revalidation, and in-band renewal must never extend a grant past what the server issued, and a failure to reach the auth server must refuse rather than admit.
- **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.
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ yanked = "deny"
ignore = [
# rsa 0.9.x Marvin Attack: test-only compatibility fixtures use published
# moq-auth 0.2.1 and moq-token 0.7, which still depend on rsa. Production
# key generation and signing use aws-lc-rs; no normal/build graph holds rsa.
# key generation and signing use rind; no normal/build graph holds rsa.
"RUSTSEC-2023-0071",

# paste is unmaintained (proc-macro, build-time only). Pulled by
Expand Down
2 changes: 0 additions & 2 deletions doc/lib/rs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Transport cryptography comes from [rind](https://github.com/moq-dev/rind).
It supports every x86\_64 CPU, aarch64 with NEON (including Raspberry Pi 4,
CM4, and Zero 2 W without crypto extensions), and armv7. Setup reports a
missing required CPU feature before starting transport cryptography.
`aws-lc-rs` and `ring` are no longer `moq-tokio` or `moq-quic` features;
remove them from dependency declarations.

## Crates

Expand Down
1 change: 0 additions & 1 deletion quest/m1/rind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,5 @@ The epic's own work, once every child has merged:

## Required

- [Transport on rind](/quest/m1/rind/transport.md) - moq-quic, moq-tokio, moq-uring, moq-rtmp, and qmux take rind, and the `aws-lc-rs`/`ring` features go
- [One typed unsupported-CPU error](/quest/m1/rind/cpu-error.md) - moq-auth, moq-hls and moq-crypto e2ee carry `moq_crypto::provider::UnsupportedCpu` and drop their own CPU-check helpers
- [moq-rtc on rind](/quest/m1/rind/rtc.md) - str0m and dimpl run DTLS, SRTP, and STUN on rind
18 changes: 7 additions & 11 deletions quest/m1/rind/cpu-error.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ any other failure by its type, the same way in every crate.
## Plan

Planned 2026-11-04 with the maintainer, from the suggested follow-up of
[moq-dev/moq#7873](https://github.com/moq-dev/moq/pull/7873)
([Transport on rind](/quest/m1/rind/transport.md)). That PR adds the
`provider` feature to moq-crypto, holding `provider::UnsupportedCpu`
(`Clone + Copy + Eq`, wrapping rind's `MissingFeature` privately), and moves
moq-quic, moq-tokio, qmux and moq-uring onto it as
`UnsupportedCpu(#[from] ...)` with `#[error(transparent)]`. This quest does
the same for the three crates it left, so it starts once that PR lands.
[moq-dev/moq#7873](https://github.com/moq-dev/moq/pull/7873), which moved
the transport crates to rind. That PR added the `provider` feature to
moq-crypto, holding `provider::UnsupportedCpu` (`Clone + Copy + Eq`, wrapping
rind's `MissingFeature` privately), and moved moq-quic, moq-tokio, qmux and
moq-uring onto it as `UnsupportedCpu(#[from] ...)` with
`#[error(transparent)]`. This quest does the same for the three crates it
left.

- ✅ #7873 lands as is, with the type in `provider`; this quest moves it
later (maintainer, 2026-11-04, on
Expand All @@ -47,7 +47,3 @@ the same for the three crates it left, so it starts once that PR lands.
Public API: breaking for moq-auth, moq-hls and moq-crypto (the variants'
payload type, and e2ee's variant name). Each gets a `## Unreleased` note in
its `MIGRATE.md`. Wire: none.

## Required

- [Transport on rind](/quest/m1/rind/transport.md) - adds `moq_crypto::provider::UnsupportedCpu`, which this wraps
47 changes: 0 additions & 47 deletions quest/m1/rind/transport.md

This file was deleted.

2 changes: 0 additions & 2 deletions rs/moq-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ percent-encoding = { workspace = true }
pollster = { workspace = true, optional = true }
reqwest = { workspace = true, features = ["rustls-no-provider", "json"] }
rind-object-store = { workspace = true, optional = true }
# The process default rustls provider, which reqwest, axum-server, and object_store read.
rind-rustls = { workspace = true }
rustls = { version = "0.23", default-features = false, features = ["std"] }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down
4 changes: 1 addition & 3 deletions rs/moq-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ fn main() -> anyhow::Result<()> {
async fn run() -> anyhow::Result<()> {
// The transport, reqwest, axum-server, and object_store all read rustls's process default.
// A CPU rind cannot run on fails here, naming the feature it lacks.
rind_rustls::default_provider()?
.install_default()
.map_err(|_| anyhow::anyhow!("a rustls crypto provider is already installed"))?;
moq_tokio::crypto::install_default()?;

let mut cli = Invocation::parse().await;
cli.log.init()?;
Expand Down
10 changes: 5 additions & 5 deletions rs/moq-gst/src/sink/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ impl Session {

/// Stop the session: a clean local close, never an error. Returns once the reconnect loop has ended.
///
/// Aborting only cancels the loop at its next await point, and a worker may be mid-dial, generating
/// TLS randomness. A process exiting in that window (`gst-launch` right after NULL) races aws-lc's
/// exit destructors, which free its seed DRBG and then `abort()` a thread asking for more.
/// Aborting only cancels the loop at its next await point, and a worker may be mid-dial. Without the
/// wait, that dial outlives the state change an application waits on before it exits (`gst-launch`
/// right after NULL).
pub fn stop(self) {
// The status task goes first, so it never reports the loop's end as a failure.
self.join.abort();
Expand Down Expand Up @@ -589,8 +589,8 @@ mod tests {
connection.poll_closed(&moq_net::kio::Waiter::noop()).is_ready()
}

// A dial still running once the element reached NULL can outlive `main`, and aws-lc aborts the
// process when a thread asks it for randomness after its exit destructors ran.
// A dial still running once the element reached NULL would outlive the state change an application
// waits on before it exits.
#[test]
fn stop_returns_after_the_reconnect_loop_ends() {
let (session, connection) = started();
Expand Down
9 changes: 4 additions & 5 deletions rs/moq-gst/src/source/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ impl SessionController {

/// Stop the session, returning once its readers have removed their pads and the connection closed.
///
/// A dial still running once the element reached NULL can outlive `main` (`gst-launch` exits right
/// after), and aws-lc aborts the process when a thread asks it for randomness after its exit
/// destructors ran.
/// A dial still running once the element reached NULL would outlive the state change an application
/// waits on before it exits (`gst-launch` exits right after).
fn stop(self, element: &super::MoqSrc) {
let _ = self.shutdown.send(true);

Expand Down Expand Up @@ -3780,8 +3779,8 @@ mod session_tests {
}
}

// A dial still running once the element reached NULL can outlive `main`, and aws-lc aborts the
// process when a thread asks it for randomness after its exit destructors ran.
// A dial still running once the element reached NULL would outlive the state change an application
// waits on before it exits.
#[test]
fn stop_returns_after_the_connection_closes() {
let element = element();
Expand Down
3 changes: 1 addition & 2 deletions rs/moq-tokio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ session determines its redirect policy; unused pinned fallbacks do not restrict
To refresh DNS, resolve and apply your address policy again before creating a new
connection. Address filtering belongs to the caller.

Transport cryptography always uses rind. Remove the `aws-lc-rs` and `ring`
features from dependencies. TLS setup checks support before using crypto:
Transport cryptography always uses rind. TLS setup checks support before using crypto:
x86\_64 needs no optional CPU extensions, aarch64 needs NEON, and armv7 is supported.
Raspberry Pi 4, CM4, and Zero 2 W use rind's paths without aarch64 crypto extensions.
Loading