Skip to content

bug: sandbox download exits 0 when the source path is rejected (outside the sandbox workspace) #2456

Closed as not planned

Description

@Dongni-Yang

Description

openshell sandbox download exits 0 when the download request is rejected because the source path is outside the sandbox workspace (/sandbox). The path-traversal guard correctly blocks the request and prints a user-facing error, but the failure is not propagated to the process exit code — scripts, test frameworks, and downstream tooling cannot detect the rejection.

Downstream report with full QA reproduction: NVIDIA/NemoClaw#7367. NemoClaw has added caller-side defenses (NVIDIA/NemoClaw#7371, NVIDIA/NemoClaw#7416 — probe the source and verify an artifact was written), but those cannot fix the CLI's own exit code, which is what that issue's repro exercises.

Reproduction Steps

  1. Have a sandbox onboarded and running (single active gateway).
  2. Run: openshell sandbox download {sandbox-name} /etc/passwd /tmp/p
  3. Check the exit code: echo $?
  4. Repeat with /sandbox/../etc/passwd and /var/lib/openshell/supervisor/creds.json — same behavior.

Observed:

$ openshell sandbox download {sandbox-name} /etc/passwd /tmp/p; echo $?
Downloading sandbox:/etc/passwd -> /tmp/p
Error:   x sandbox source path '/etc/passwd' is outside the sandbox workspace (/sandbox)
0

Expected: non-zero exit (e.g. 1) whenever the source path is rejected, so callers can detect the failure.

Environment

Device:        Ubuntu 24.04 VM (x86_64) and DGX Spark (aarch64)
OS:            Ubuntu 24.04 / Linux 6.8.0-124-generic
Architecture:  x86_64 / aarch64
Node.js:       v22.23.1
Docker:        Docker Engine 29.5.3
OpenShell CLI: openshell 0.0.85

Reproduced on both x86_64 and aarch64. Security-relevant: the rejected paths include credential files (/var/lib/openshell/supervisor/creds.json), and an exit-0 rejection means automated tooling treating exit codes as ground truth records a successful download that never happened.

Logs

See the observed output above; full QA logs in NVIDIA/NemoClaw#7367.

Activity

  1. added
    state:triage-needed
    on Jul 24, 2026
  2. github-actions commented on Oct 18, 2026

    @github-actions

    This issue has had no activity for 14 days and is now marked stale. It may be closed in 14 days if there is no further activity. Comment or remove the state:stale label to keep it open.

  3. added
    state:stale
    on Oct 18, 2026
  4. TaylorMutch commented on Oct 20, 2026

    @TaylorMutch
    Contributor

    📋 triage-agent

    Closing because we could not reproduce the reported exit-zero behavior in local testing. Using openshell 0.1.5-dev.55+g77929d9c1 against a running OpenShell sandbox, direct subprocess invocations for /etc/passwd and /sandbox/../etc/passwd both returned exit code 1, printed the workspace-boundary rejection, and created no destination file. A nonexistent in-workspace source also returned 1.

    These tests ran from macOS; the original Ubuntu/DGX Spark release binaries were not retested. Current source propagates the download error to the process exit status, but we have not identified a fixing commit and are not claiming the original observation was invalid.

    If this is reproducible on a release after the 0.1.x series, please open a new issue and link this one. Include the exact OpenShell version and executable path, OS/architecture and deployment details, a minimal command, stdout/stderr, and the exit status captured directly from the executable without a shell wrapper or pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:stalestate:triage-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions