Repository navigation
Closed
Labels
scope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaultsource/agentFiled by an agenttype/securityType security: a vulnerability or a leak
Milestone
Description
Problem
#1115 refuses a sandbox workspace that holds the container engine socket (including the directory a symlinked socket resolves to) or the user's runtime directory (XDG_RUNTIME_DIR, with its session bus). Other user sockets that give a container the user's authority are not covered (review of #1115, 2026-10-08):
- the SSH agent socket,
/tmp/ssh-*/agent.N(SSH_AUTH_SOCK); - VS Code's SSH-auth socket,
/tmp/vscode-ssh-auth-*.sock; - the X11 socket directory,
/tmp/.X11-unix.
/tmp itself is refused only when XDG_RUNTIME_DIR lies under it. A workspace of /tmp/ssh-XXXX is accepted today, which hands the sandbox the user's SSH agent. A socket file given as the workspace is not exploitable, because both runners set working_dir=/workspace and the container fails to start.
Acceptance criteria
- A workspace that is, or holds, the directory of
SSH_AUTH_SOCK(resolved, as fix(security): a sandbox workspace can never expose the container engine socket or the user's runtime directory and its session bus #1115 resolves the engine socket) or/tmp/.X11-unixis refused, and the message names the workspace and the protected directory. VS Code's SSH-auth socket is covered throughSSH_AUTH_SOCKwhen VS Code sets it. - An unset or relative
SSH_AUTH_SOCKadds no rule, as fix(security): a sandbox workspace can never expose the container engine socket or the user's runtime directory and its session bus #1115 treats an empty or relativeXDG_RUNTIME_DIR. - The check stays request-free and is shared by
devops docker sandbox,devops test sandbox,devops sandbox deployand both MCP tools; new cases join_REFUSED_WORKSPACES(tests/test_sandbox_lifecycle.py). - Tests are offline, each call phase stays under 1 s, and
uv run devops cipasses;changelog.d/<n>.mdrecords the change.
Strategic alignment
- Security hardening found while reviewing fix(security): a sandbox workspace can never expose the container engine socket or the user's runtime directory and its session bus #1115. Related: fix(security): a sandbox workspace can never expose the container engine socket or the user's runtime directory and its session bus #1115, fix(docker): the Docker endpoint check covers the endpoint the SDK dials, including contexts and the TUI, and pushes accept registry ports #1108 (Docker contexts).
Found on 2026-10-08 while delivering #1115. Filed directly with no priority; the roadmap service's intake sets Priority, Value and Effort.
Metadata
Metadata
Assignees
Labels
scope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaultsource/agentFiled by an agenttype/securityType security: a vulnerability or a leak
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
A sandbox container holding the user's SSH agent socket can authenticate as the user to any remote host, making this a high-severity security gap in an existing protection mechanism.Preventing a container from silently inheriting the user's full SSH identity and X11 session is critical to the sandbox's trust model.The pattern already exists in #1115 for the engine socket and XDG_RUNTIME_DIR; extending it to SSH_AUTH_SOCK and /tmp/.X11-unix across four entry points plus tests is bounded but non-trivial.dan-petty commentedon Oct 8, 2026
Placed in v0.2.30 on 2026-10-08 at the owner's request ("Populate 10 security and ci issues into each v0.2.30, v0.2.31, and v0.2.32 milestone"). This is a person's placement. Release theme: P1 secret and sandbox-boundary fixes, the review tools lock, kube-linter finding identity and a faster gate. Position 4 of 10 in the release's planned merge order. Its board Status is set to Ready, so the release-start fill keeps it.
dan-petty commentedon Oct 8, 2026
Linked: #1117, which maps rootless sandboxes to the host user; after that only this item's refusal keeps the SSH agent's directory out, so #1117 lands after this item. Found by the 2026-10-08 backlog review.
fix(security): a sandbox workspace never holds the user's ssh agent o…
dan-petty-bot commentedon Oct 9, 2026
What changed
#1463, merged into
release/v0.2.30as 97c0f6b.6 file(s) changed.
How it was verified
Check runs at 85aff68:
Acceptance Criteria of
docs/agent/tasks/task-1384-sandbox-workspace-never-holds-ssh-agent-or-x11-socket.md:test_a_workspace_overlapping_a_socket_directory_is_refused_before_any_engine_call(tests/test_sandbox_lifecycle.py), parametrised over both runners, refuses each new case before any engine call, and the client mock records no call: theSSH_AUTH_SOCKdirectory, the directory that holds it, the directory a symlinked agent socket leads to, atmp_pathholding a VS Code-stylevscode-ssh-auth-*.sock,/tmp/.X11-unix, and/tmp.test_a_workspace_beside_the_ssh_agent_directory_is_mountedmounts a workspace under the agent's directory with both runners, and mounts it withSSH_AUTH_SOCKunset, empty and relative (agent.1, with the workspace as the working directory).workspaceset to the SSH agent's directory,docker_sandboxandsandbox_deployraiseSandboxValidationErrorand_run_mcp_cmdis not called.validate_sandbox_workspace, which every entry point already runs; it readsSSH_AUTH_SOCKand resolves paths only.changelog.d/1384.mdlists the newly refused workspaces. The tests are offline, start no container, and each call phase stays under 1 s.SSH_AUTH_SOCKis set, on a build with this fix, rundevops docker sandbox --workspace "$(dirname "$SSH_AUTH_SOCK")" -- trueanddevops docker sandbox --workspace /tmp -- true. Confirm that both are refused before any container is created, and record the results on the issue.feat(release): v0.2.30 (#1473)