Skip to content

security(cleanroom): verify every vector and sign Room B evaluation evidence - #12

Merged
ruvnet merged 22 commits into
mainfrom
fix/cleanroom-harness-exit-bypass-20261008
Oct 9, 2026
Merged

ruvnet merged 22 commits into
mainfrom
fix/cleanroom-harness-exit-bypass-20261008

Conversation

@ruvnet

@ruvnet ruvnet commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Security finding

The previous scaffold imported implementation.mjs into the trusted Node test process before registering test vectors. A malicious implementation containing process.exit(0) could terminate the runner with exit code zero without executing any approved vector. The v1 Docker evaluator used exit status alone and could report a false positive.

Implementation

  • Generates a trusted compat.test.mjs that never imports independent implementation code into its own process. Each approved vector is evaluated in a short-lived, bounded subprocess, with strict primitive JSON result checking, timeout and minimal environment.
  • Requires an unambiguous TAP footer: tests and passes must equal every approved vector, with no failed, skipped, cancelled or TODO tests. Exit code zero without that footer is a failure.
  • Upgrades report protocol to rudevolution.cleanroom.sandbox-report/v2 with executed/passed vector counts, SHA256 policy and harness digests, plus existing approval, implementation, runtime image and log digests.
  • Adds optional Room B worker Ed25519 signing after Docker cleanup. The attestation envelope is separately verifiable using a pinned out-of-band worker public key, expected worker ID and approved-artifact SHA256. The worker key never enters the Docker mount.
  • Adds negative tests for premature exit, forged TAP output, void return mismatch, incomplete counts, report tampering, untrusted key and worker identity; real CI Docker integration exercises success, signed receipt verification and malicious process.exit(0).
  • Updates README, clean room runbook, ADR 141 and creates ADR 142 describing the incident, protocol, residual risks and migration.

Validation

Local Node smoke: npm run test:cleanroom yields 26 passing, 1 intentional Docker skip, zero failures. The dedicated GitHub Actions Docker job sets the pinned image and must pass (no skip). Other Node/Rust/dashboard checks remain unchanged.

Breaking change

Existing Room B scaffolds are intentionally rejected because their test harness predates the security fix. Re-scaffold from the original approved artifact and copy only independently authored implementation.mjs into the new room. Previously issued v1 evaluation reports are not reclassified as trustworthy v2 reports.

Boundaries

This is not legal clearance, independent authorship proof, host attestation or general semantic equivalence. An implementation can hardcode approved public vectors. The container shares a kernel with its isolated host; production still requires separate Room A/B identities, data, model state, evidence custody and held-out behavior tests.

Acceptance

  • Exit-zero implementation and forged TAP must fail, with no verified passing vectors.
  • Valid independent synthetic implementation passes all three vectors inside real Docker with network disabled and read-only files.
  • Altered worker report must fail Ed25519 verification.
  • CI Node 22/24, dedicated Docker, Rust and dashboard builds/audit pass.

Rollback

Keep the v2 execution gate even if optional worker signing is disabled. Do not revert to pre-v2 direct code import or exit-status-only success.

Node 24 portability correction

An earlier CI attempt revealed that Node 24 can emit a human-readable test reporter rather than TAP by default. The negative regression assertions initially expected TAP text. The generated Docker runner and nested regression subprocesses now explicitly request --test-reporter=tap; the evaluator still requires complete counters, not merely exit code zero. The earlier Docker integration succeeded; fresh Node 22, Node 24 and Docker CI are required on the updated head.

ruvnet added 22 commits October 8, 2026 19:41
@ruvnet
ruvnet merged commit 2245055 into main Oct 9, 2026
4 checks passed
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