Repository navigation
Seal the release summary sandbox: no toolchain roots or skills, only node - #2243
Merged
Merged
Conversation
…only node The release summary Session promised no host filesystem read access, but the shared sandbox bound ~/.cargo, ~/.rustup, ~/.nvm and the skills folder. A sealed Host binds none of them, only the node an npm-installed Harness names in its #! line; an unresolvable node fails the Session so the generated-notes fallback applies. Closes #2230
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The release summary Session's sandbox used to bind every host toolchain root (
~/.cargo,~/.rustup,~/.nvmand their env overrides) and the skills folder. That broke Spec #2054's promise of no host filesystem read access. It is now sealed. Other Sessions keep today's binds.pub(crate) struct Request<'a> { - pub skills_dir: &'a Path, + pub host: Host<'a>, // Tools { skills_dir } | Sealed } prepare(request) - bind skills_dir; toolchains_into(home) + match request.host + Tools { skills_dir } => bind skills_dir; toolchains_into(home) // Trials, Graders, Process sessions + Sealed => node_into(harness binary) // release summary ... - conceal_toolchain_credentials + if Tools: conceal_toolchain_credentialsnode_intoreads the Harness's#!line:#!/abs/node: binds that one file read-only at that path.#!/usr/bin/env node: binds only the resolved hostnodeat its canonical path, with its directory first onPATH.If
nodecan't be resolved,preparefails withUnavailable, so the existing fallback (patch plus GitHub generated notes) applies. The binds are never widened.ADR 0013's exception and the manual are unchanged, as the issue's Decision asks.
Evidence
Execution evidence
Cause:
src/release/summary.rswritebuilt its sandbox withsandbox::prepare, which always calledtoolchains_into. That bound every existing toolchain root read-only, so the summary Harness could read anything under~/.nvm.ea4bd94f, with the issue's test added):cargo test --locked --test release -- release_summary_sandbox_binds_no_host_toolchain_directoriescargo test --locked --test release -- native::release_summary_runs both release tests:writeis switched back to the old binds (Host::Tools), both tests fail.cargo test --locked --bin thirdshift sandbox::testsgives 30 passed. This includesa_harness_names_node_only_in_its_interpreter_lineanda_sealed_harness_binds_its_node_alone_or_fails; the second covers an unresolvablenodefailing withneeds node.scripts/affected-tests mainselected the full suite.PASS cargo test (774.60s).experiments release::native_release_waits_for_leak_decisions_before_any_pushfailed with "Experiment is already running … lock acquisition failed"; it then passed 3 of 3 times.process findings::fixing_dispatches_each_reproduced_finding_and_keeps_unreproduced_findings_privatepassed 2 of 3 times. It runs throughsandbox::for_trial, which keeps the unchangedHost::Toolspath.cargo test --locked --no-fail-fastpassed.Visual evidence
None: no UI changes.
Merge Danger
Door: two-way
Reverting restores the old binds.
Blast Radius: release-summaries
Only the release summary Session changes. Its worst case is a Harness whose
nodecan't be resolved: release summaries then fall back to patch plus GitHub generated notes instead of a written summary. Trials, Graders and Process sessions useHost::Toolsand are unchanged.Unaddressed findings
Standards
nodebind. Declined. The issue's Decision (Release summary sandbox can read host toolchain directories #2230) asks for exactly this bind and says: "Keep the ADR 0013 exception and the manual's wording as they are, since the code now matches them." The Day shift has already made the call, so no new issue was filed.Spec
None.
Review coverage: both reviewers read every changed file (
src/release/summary.rs,src/sandbox.rs,tests/release/native.rs).Closes #2230
Built with claude 2.1.314 · opus · default effort
Security review outcome
No unaddressed introduced findings.