[Linux][Security] openshell sandbox download returns exit code 0 when rejecting out-of-workspace paths
- Dominant language
- TypeScript
- Stars
- 22.5k
- Forks
- 3.1k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 715
Description
## Description
`openshell sandbox download` returns exit code 0 even 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 non-zero exit code is not propagated to the caller — scripts and test frameworks cannot detect the failure.
Platform scope: Reproduced on Ubuntu 24.04 x86_64 and DGX Spark aarch64; other platforms not tested.
Regression: Unknown — earlier versions not tested.
## Environment
```text
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
npm: 10.9.8
Docker: Docker Engine 29.5.3
OpenShell CLI: openshell 0.0.85
NemoClaw: nemoclaw v0.0.90
OpenClaw: unknown
```
## Steps to Reproduce
1. Have a sandbox onboarded and running.
2. Run: `openshell sandbox download {sandbox-name} /etc/passwd /tmp/p`
3. Check exit code: `echo $?`
4. Repeat with `/sandbox/../etc/passwd` and `/var/lib/openshell/supervisor/creds.json`
## Expected Result
`openshell sandbox download` exits non-zero (e.g. exit 1) when the source path is rejected. Callers can detect download failure via the exit code.
## Actual Result
Exit code is 0 for all rejected paths. Example:
```text
$ 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
```
Same behavior for `/sandbox/../etc/passwd` and `/var/lib/openshell/supervisor/creds.json`. Reproduced on both Ubuntu 24.04 x86_64 and DGX Spark aarch64 with a single active gateway.
## Logs
Not captured.
Contributor guide
Assessment
This issue has not been assessed yet.