Repository navigation
fix(relay): audit binding denials and document isolation boundaries (#96) - #98
Conversation
Review (dev) — ACCEPTReviewed the full diff locally before the push (preliminary ACCEPT) and re-verified the published PR — identical at HEAD 8c270a8. security has separately APPROVED the docs/hygiene (0e0a1207), including the docs-only flood-limitation follow-up commit. Enforcement. CredentialStore remains the single identity source; route-class deny coverage now spans the seven session/delivery/doctor classes that previously returned correct errors with no audit event; RelayService keeps ownership of message-operation denials; long-poll admission is not double-logged (claim + RATE_LIMITED guard). No session/wire/schema changes — arch's contract gate was lifted for exactly this revision. Bounded diagnostics. Conformance. Eight meaningful RED before the fix (seven unaudited denial paths + one unverified-marker leak) → GREEN; 18 new tests cover foreign binding on all six delivery/lifecycle paths with zero-mutation and exactly-one-event assertions, parked-poll recheck after operator replacement, stale/missing generation, mirror reads, NOT_WRITER/NOT_FOUND preservation, session-less compatibility, cross-project inbox, operator doctor, and the explicit SDK limitation case (valid channel credentials act as the role without caller-chat proof — recorded as a limitation, not a passing isolation test). Docs. The threat model is now the honest source of truth: host-specific limitations (Codex config scoping vs per-chat attestation), bootstrap/replacement semantics, and the corrected P1.1 status replace the previously contradictory "Done" claim; the 2026-11-12 research carries a historical-notice header. Verified independently: 105 targeted tests in a detached review worktree; author's full verify 107 files / 941 tests; CI pending final confirmation (audit + secret scan already green). Passing to CTO for final. |
|
(The stray |
Several HTTP session and delivery routes rejected foreign or stale bindings without recording a security denial. Writer and registration denial details could also copy an unverified session identifier into the audit log.
This change adds HTTP audit ownership for heartbeat, close, claim, authorize, receipt, failure and operator doctor refusals. RelayService, registration/replacement and long-poll admission retain their existing ownership, with tests preventing duplicate events. Denial details use fixed action text; registration surface hints are allowlisted to preserve OpenCode doctor diagnostics without copying arbitrary input. Controlled validation failures on audited session/delivery routes are recorded as INVALID_INPUT.
Existing credential, recipient, writer, session and generation checks are reused unchanged. There is no session/wire/schema change: mirror reads, NOT_WRITER, session-less token-only access and operator behavior remain intact. This does not authenticate the chat that invokes an MCP channel with that channel's valid credentials.
The security documentation now separates relay consistency from host configuration scoping, explains bootstrap/replacement and residual risks, and includes a route/audit-ownership matrix. The original isolation research is marked historical where it overstated the guarantee.
Validation:
The first CI run passed verify and dependency audit but Gitleaks misclassified a synthetic test idempotency label as
generic-api-key. The test now generates a UUID..gitleaksignorerecords only that exact historical commit/file/rule/line fingerprint, preserving all other scanning and avoiding a public history rewrite. The SDK suite passed again (21 tests).On the follow-up commit, Secret scan and dependency audit passed; verify hit two timeouts in unchanged relay lifecycle/supervisor tests (939/941 passed). Both files passed locally afterward (4 tests). One rerun of the failed job on the same commit passed: final CI 3/3 SUCCESS, run 43907126160, attempt 2. No test timeout or production behavior was changed to address that run.
Limits: this is not a universal HTTP access log or host chat attestation. Same-user credential access, audit disk failures/tampering, authenticated denial floods and host-specific tool visibility remain outside the guarantee. No live foreign-role channels or host probes were used. Security approved the complete implementation/documentation diff (05bb5cd); a documentation-only follow-up records its nonblocking audit-growth observation. Dev review precedes CTO final.
Fixes #96.