Repository navigation
fix(runtime): harden shell boundaries and make CI reliable - #252
Merged
Merged
Conversation
The win32 fallback in resolveSandboxTmpDir used a literal with doubled backslashes, so it resolved to C://Windows//Temp instead of C:/Windows/Temp. Add unit tests for the win32 branch, which had no coverage before (TEMP precedence over TMP/USERPROFILE, and the no-env fallback).
buildMacosSandboxExecCommand joins assignments into "export KEY=VALUE". Temp dirs under macOS user homes can contain spaces (e.g. /Users/John Doe/...), so an unquoted value is split by the shell and the variable ends up truncated. Quote the value with POSIX single-quote escaping. The Linux bwrap path is untouched: it parses key=value and passes them as separate argv entries.
…daries Keep sandbox environment entries raw and encode values at each POSIX, cmd.exe, and socat boundary. Preserve target-platform temporary path semantics and mount the configured Linux sandbox temp directory. Cover actual Git SSH invocation, metacharacter filenames, nested seccomp commands, proxy addresses, and native platform launchers with regressions.
Apply Commander help/exit overrides to existing subcommands so help tests cannot terminate the full suite with a misleading successful exit. Stop pre-commit immediately when formatting fails. Exercise that behavior with executable hook tests and run focused platform regressions before the independent, still-required dependency security audit in the CI matrix.
CrazyBoyM
marked this pull request as ready for review
October 29, 2026 01:34
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.
Paths containing spaces, quotes, command substitutions, or socat separators can break sandbox proxying or become shell syntax. This PR keeps data literal across the shell, Git, socat and desktop-launcher boundaries, fixes the macOS Git SSH regression in #251, and repairs CI so its results reflect completed, isolated tests.
Includes both original commits from @ZX1aoF in #251, preserving attribution. This replacement PR also addresses the related defects found during the command-construction audit.
Runtime changes
GIT_SSH_COMMAND; Git treats the whole command as one executable name.spawn(command, args, { shell: true })reserializes filenames as shell code. Windowsstartadds another parser.Configured editor commands remain trusted shell syntax. The audit also checked foreground/background/promotable runtime paths, process adapters, hooks, MCP helpers, ripgrep and clipboard launchers.
CI and test corrections
bubblewrap/socatand require the network integration prerequisites in CI.CI=true GITHUB_ACTIONS=trueand all 24 interaction tests passed after the fixture correction.Dependency audit policy
The previous full audit blocked all three jobs on 9 pre-existing high advisories in the unchanged main-branch dependency graph, skipping other validation. CI now blocks newly introduced high/critical package + installed version + advisory combinations against the trusted event base commit. Both lockfiles are compared using the same advisory set. Registry errors, malformed responses and unsupported lock records fail closed; policy fixtures cover new vulnerable versions, scoped/prerelease versions, and invalid inputs.
The 9 existing advisories remain unresolved and are listed in the job summary. No dependencies or lockfiles are changed.
bun run security:auditremains the full blocking audit for release validation; in particular, the Zod major-version migration is not disguised by importing its still-vulnerable v3 compatibility code.Validation
6066ddae8ef734b0f8fec28293f60805137eca77: Ubuntu, macOS and Windows all green, including production builds on all three platforms.sandbox-execand Windows cmd/.cmd/startregressions executed successfully. Dependency comparison reported 9 existing high/critical findings, 0 newly introduced.References: Git SSH environment semantics, Node child-process shell argument warning, Bash quoting.