You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(security): host sandbox applies no output, process or tmpfs limits and binds the wrong repository root #663
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/securityType security: a vulnerability or a leak
Found in the release/v0.2.23 review (line numbers at 7fdaa9d).
The bubblewrap host sandbox runs LLM-generated verification criteria, but applies none of its policy's resource limits.
Output is unbounded until the process exits.proc.communicate() buffers all output, and max_output_bytes is applied only afterwards (src/devops_cli/sandbox/host.py:61-83). A criterion such as cat /dev/zero passes validate_criteria_command. It produced 328M characters and 1.27 GB RSS in one second, so the default 5-second timeout means several GB.
Process and tmpfs limits are ignored. The policy's pids_limit and the tmpfs size=64m,noexec options are never passed to bwrap (host.py:95-96, :158-159; src/devops_cli/sandbox/models.py:332-336). A fork loop such as python3 -c "import os\nwhile 1: os.fork()" passes the AST check and can exhaust host PIDs for the whole timeout.
The wrong directory is bound. The sandbox binds find_worktree_root(cwd), which returns the top-most directory holding .git or pyproject.toml (host.py:150-162).
For a clone nested under a workspace (repos/<clone>), that exposes the whole workspace to the reviewed repository's code, .env files and sibling repositories included.
For a linked worktree, the git directory that its .git file points to is not bound, so every git grep/log/diff criterion fails with "not a git repository".
test_host_sandbox_cannot_list_home uses tmp_path, so it never exercises either case.
Remediation Plan
Stream stdout and stderr with a byte cap, and kill the process group once the cap is exceeded.
Enforce pids_limit (for example an RLIMIT_NPROC set before exec) and pass tmpfs size limits to bwrap. Document any option bwrap cannot express.
Bind the nearest repository root of the reviewed tree. For linked worktrees, also bind the common git directory read-only.
Add tests:
output over the cap is cut off and the process is killed;
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/securityType security: a vulnerability or a leak
Activity
fix: harden sandbox, pricing ledger, cloudflare public IP bypass, and…
dan-petty commentedon Sep 28, 2026
Closed by #676, merged into
release/v0.2.23.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.