Skip to content

fix: redact release credential diagnostics - #7482

Merged
kixelated merged 5 commits into
releasefrom
backport/log-secrets
Nov 3, 2026
Merged

kixelated merged 5 commits into
releasefrom
backport/log-secrets

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Release diagnostics expose SETUP credentials, request query strings, CONNECT URLs and headers, and GOAWAY redirect credentials. Refusal paths and verified roots can inject log records. This ports the repository-owned parts of moq-dev/moq#7200 and closes the external CONNECT leak.

Approach

  • Give existing credential-bearing types a manual redacting Debug, keeping their token types and public byte fields.
  • Redact opaque SETUP parameter values, native request-target queries, all three GOAWAY types, received and duplicate GOAWAY redirects, and configured cluster peer URLs.
  • Remove malformed-message byte dumps, which can contain credentials even when parsing fails.
  • Escape auth refusal fields, permission errors, and relay grant diagnostics.
  • Raise the workspace web-transport-proto minimum to 0.6.4, which redacts ConnectRequest's Debug: URL userinfo, query, and fragment, plus every header value except origin and user-agent (moq-dev/web-transport#475). web-transport-moq 1.3.5 and web-transport-iroh 0.7.0 log that type and require ^0.6, so they get the fix without their own release.
  • moq-uring's quic::web::Request Debug printed the raw url::Url, query included. It now delegates to the redacted ConnectRequest.
  • Capture traces for SETUP, GOAWAY, malformed frames, and auth refusals. Extend the peer and live mock-transport GOAWAY tests. Pin the CONNECT redaction with a moq-uring unit test, and assert in the io_uring WebTransport end-to-end test that an accepted request's Debug omits its ?token= query.

Impact

  • Public API: existing types, fields, trait implementations, and package versions stay the same, and nothing new is exported. Diagnostic formatting now redacts credentials and escapes control characters. moq_uring::quic::web::Request's Debug shows a connect field instead of url.
  • Dependencies: downstream builds resolve web-transport-proto 0.6.4 or later.
  • Wire: MoQ encoding, JSON serialization, credential delivery, and authorization behavior are unchanged. Human-readable auth HTTP refusal text escapes control characters in the path and root.

Alternatives

The quest settled on manual Debug for independent credential types, avoiding a shared type and a breaking migration. This branch ports the behavior onto release rather than importing trunk's incompatible transport implementation.

Decisions

  • CONNECT leak in the external transports (maintainer, 2026-11-02): ✅ fix ConnectRequest's Debug upstream, publish a compatible web-transport-proto patch, then raise the minimum here. The alternative was to land without it and leave the leak to a follow-up. The upstream half merged in moq-dev/web-transport#475, and 0.6.4 is on crates.io.
  • Choice made without asking: fix the moq-uring Request Debug here, because the bump exposed it and it leaks the same credential.

Validation

  • quest gate nix develop --command env MOQ_STRICT=1 just check origin/release passed on d6c66b961c. That covers fmt, clippy, rustdoc, and dependency hygiene, plus nextest runs of 5,735 tests (11 skipped), 387 (3 skipped), 133, and 78. The mbx "Argument list too long" failure that blocked the last attempt did not recur.
  • cargo test -p moq-uring --lib --test web ran the new unit test and all 7 io_uring WebTransport tests, none skipped.
  • quest check --base origin/release: 439 documents OK.
  • 6db8763c6c only adds a conflict-free merge of origin/release (release-plz version bumps). cargo metadata --locked still resolves.

Review

Codex (codex exec review), gpt-6.1-sol, medium effort. Round 1 on d6c66b961cba3058abf712c04dfd66070bedda3d against origin/release at 6e43cd6140 reported no findings. The current head, 6db8763c6cb8ef4ed5aad9c9eb220eea576515ea, adds only a conflict-free merge of origin/release, so the guide's merge exemption covers it.

Follow-ups

moq-dev/moq#7477 deletes the quest on main and applies the same proto minimum and moq-uring fix there. Merge this PR first.

(Written by GPT-6.1 Sol; updated by Claude Opus 5.5)

kixelated and others added 2 commits October 31, 2026 22:33
Port the diagnostic redaction from #7200 while retaining release types and wire encoding. Also redact malformed-message dumps and duplicate GOAWAY redirects.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
kixelated and others added 3 commits November 2, 2026 18:56
…CT Debug

web-transport-proto 0.6.4 redacts ConnectRequest's Debug (URL userinfo,
query, fragment, and header values), which web-transport-moq and
web-transport-iroh log. Raise the workspace minimum so release builds
cannot resolve 0.6.3.

moq-uring's Request Debug printed the raw url::Url, query included; it now
delegates to the redacted ConnectRequest. Tests pin both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 03:13

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 6db8763

No actionable defects found in the credential redaction and diagnostic changes. Manual Debug redaction and removing raw malformed-frame traces provide a focused boundary; the transport dependency minimum covers the external CONNECT diagnostic path.

Verification: static GitHub review only; no builds, trace capture, io_uring tests or live transport checks run.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ The redaction itself is thorough and well-tested. One adjacent credential in the same Config::load trace is still unredacted on this branch.

Reviewed changes

  • Manual redacting Debug: moq-auth::request::{Request, Token}, moq-net::setup::Token, ietf Setup/Client/Server, ietf Parameters, lite Setup/Parameters, all three GOAWAY types, and cluster::Peer (URL userinfo/query now redacted via moq_tokio::RedactedUrl) now print kind/length instead of bytes/URI.
  • Escaped diagnostics: peer/operator-supplied path, root, id, and refusal/grant fields switch from % (Display) to ? (Debug) so control characters cannot forge log records.
  • Malformed frames: the ?raw byte dump is dropped from the ietf and lite decode-failure warnings.
  • External CONNECT: the workspace web-transport-proto minimum rises to 0.6.4, and moq-uring::quic::web::Request's Debug delegates to the now-redacted ConnectRequest.
  • Tests: new unit tests pin the redaction in moq-auth and moq-net, the moq-net GOAWAY integration tests are extended, and a moq-uring CONNECT test covers URL userinfo/query/fragment and header values.

ℹ️ cluster.lan.secret still reaches the final config trace

Config::load logs the whole resolved config at tracing::trace!(?config, "final config") (rs/moq-relay/src/config.rs:210). On this branch LanConfig::secret is an Option<String> that accepts an inline 64-hex key (rs/moq-relay/src/cluster.rs:769), and LanConfig derives Debug (rs/moq-relay/src/cluster.rs:736), so that key is printed verbatim whenever TRACE logging is on. This is the same leak class the PR fixes for peer URLs, and main closed it by making the field a PathBuf (file only). It is pre-existing and lower stakes than the peer-URL leak, so flagging rather than blocking; Peer-style redaction would close it here too.

Technical details
# Inline LAN secret printed by the resolved-config trace

## Affected sites
- `rs/moq-relay/src/config.rs:210` — `tracing::trace!(?config, "final config")` prints the derived Debug of the whole `Config`.
- `rs/moq-relay/src/cluster.rs:769` — `pub secret: Option<String>` accepts an inline 64-hex key or a path to one.
- `rs/moq-relay/src/cluster.rs:736` — `LanConfig` derives `Debug`.
- `rs/moq-relay/src/cluster.rs:657` — `lan` is `#[cfg(feature = "cluster-lan")]`, which is in `default` (`rs/moq-relay/Cargo.toml:28`).

## Required outcome
- The resolved-config trace must not print an inline `cluster.lan.secret`.

## Suggested approach (optional)
- Give `LanConfig` a manual `Debug` that renders `secret` as `Some("...")` (mirroring the `Peer` impl this PR already touched), or make it file-only (`PathBuf`) as on `main`.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

kixelated added a commit that referenced this pull request Nov 3, 2026
… quest

web-transport-proto 0.6.4 redacts ConnectRequest's Debug, which
web-transport-iroh logs. Raise the workspace minimum so builds cannot
resolve 0.6.3.

moq-uring's Request Debug printed the raw url::Url, query included; it now
delegates to the redacted ConnectRequest. Tests pin both.

The release backport (#7482) completes the log-secrets quest, the last
child of the security-audit epic, so both are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated enabled auto-merge November 3, 2026 03:40
@kixelated
kixelated merged commit 338cb9b into release Nov 3, 2026
32 of 41 checks passed
@kixelated
kixelated deleted the backport/log-secrets branch November 3, 2026 03:48
@kixelated kixelated mentioned this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant