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): the host sandbox declares a noexec /tmp it never applies #798
priority/p3-lowPriority P3: a small improvementscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/securityType security: a vulnerability or a leak
The host sandbox policy declares /tmp as size=64m,noexec (sandbox/models.py:373), but only the size reaches bubblewrap (sandbox/host.py:60-68, :365-369). Bubblewrap has no noexec option for a tmpfs, so the flag is dropped without a word. In a repro, a script written to the sandbox's /tmp ran.
The output-cap test (tests/test_host_sandbox.py:172) uses a writer that exits by itself after 50 KB, so it never tests that the process is killed.
Placed in v0.2.32 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: URLs and host keys read by the library that dials, ollama hardening, and pull-request test-quality tooling. 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.
Linked: #698. The host sandbox reads the same SandboxPolicy as the container runners (sandbox/models.py:382-391); #698 asks that dropping noexec here keeps it for containers. Found by the 2026-10-08 backlog review.
Bubblewrap has no noexec option for a tmpfs. The host sandbox read the same SandboxPolicy as the container runners (/tmp as size=64m,noexec), so only the size reached bubblewrap and noexec was dropped without a word. Inside the sandbox, /proc/self/mounts showed /tmp as rw,nosuid,nodev,size=65536k, and a script written to /tmp ran.
The host sandbox cannot enforce noexec: the confined child has no capability to remount /tmp, and Landlock would need a dependency outside the standard library. So the host now stops declaring it:
_tmpfs_mount_args replaces the hand-written size regex. docker.utils.parse_bytes (an existing dependency) turns size into --size <bytes>. Any other option (noexec), and any size that parse_bytes refuses (size=50%), raises a SandboxValidationError naming the option and path instead of being dropped.
HostSandbox.__init__ builds the tmpfs arguments once, so a policy that bubblewrap cannot apply fails when the sandbox is constructed, not halfway through execute().
SECURITY.md, item 6: the host sandbox's /tmp is a private 64 MiB tmpfs mounted nosuid and nodev, which the confined command can write to and execute from.
The output-cap test now shows the kill. Its old writer exited by itself…
Acceptance Criteria of docs/agent/tasks/task-798-host-sandbox-declares-a-noexec-tmp-it-never-applies.md:
The host stops declaring noexec.test_host_sandbox_default_policy_mounts_tmp_as_declared shows that the default host policy declares /tmp as size=64m and that the arguments mount it with --size 67108864 --tmpfs /tmp.
An option bubblewrap cannot apply is refused.test_host_sandbox_refuses_a_tmpfs_option_bubblewrap_cannot_apply constructs host sandboxes whose policies declare size=64m,noexec and size=50%, and expects a SandboxValidationError naming noexec and size=50%.
Containers keep noexec.DEFAULT_SANDBOX_POLICY in src/devops_cli/sandbox/models.py is unchanged, and tests/test_sandbox_lifecycle.py still pins its size=64m,noexec tmpfs.
The docs say which. SECURITY.md item 6 says that the host sandbox's /tmp allows execution, and why.
The cap kills an endless writer.test_host_sandbox_kills_an_endless_writer_at_the_output_cap (bubblewrap-marked) runs a shell loop that ignores SIGPIPE, with a 30 s timeout and a 1024-byte cap. It asserts that the run fails without timing out, keeps at most 1024 bytes, reports the cap, and ends within 1 s. That is under the reap's 1 s grace, so the test fails if the kill at the cap is removed (the run then takes about 1.06 s, or about 2.09 s with no kill at all).
No RLIMIT_NPROC and no fork bombs. No test sets a process limit or spawns processes without bound.
Release.changelog.d/798.md records the change under ### Security.
priority/p3-lowPriority P3: a small improvementscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/securityType security: a vulnerability or a leak
Activity
dan-petty commentedon Oct 8, 2026
Placed in v0.2.32 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: URLs and host keys read by the library that dials, ollama hardening, and pull-request test-quality tooling. 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: #698. The host sandbox reads the same
SandboxPolicyas the container runners (sandbox/models.py:382-391); #698 asks that droppingnoexechere keeps it for containers. Found by the 2026-10-08 backlog review.fix(security): the host sandbox declares a noexec /tmp it never appli…
dan-petty-bot commentedon Oct 9, 2026
What changed
#1502, merged into
release/v0.2.32as 630fb2d.5 file(s) changed.
How it was verified
Check runs at 4eeb227:
Acceptance Criteria of
docs/agent/tasks/task-798-host-sandbox-declares-a-noexec-tmp-it-never-applies.md:test_host_sandbox_default_policy_mounts_tmp_as_declaredshows that the default host policy declares/tmpassize=64mand that the arguments mount it with--size 67108864 --tmpfs /tmp.test_host_sandbox_refuses_a_tmpfs_option_bubblewrap_cannot_applyconstructs host sandboxes whose policies declaresize=64m,noexecandsize=50%, and expects aSandboxValidationErrornamingnoexecandsize=50%.DEFAULT_SANDBOX_POLICYinsrc/devops_cli/sandbox/models.pyis unchanged, andtests/test_sandbox_lifecycle.pystill pins itssize=64m,noexectmpfs./tmpallows execution, and why.test_host_sandbox_kills_an_endless_writer_at_the_output_cap(bubblewrap-marked) runs a shell loop that ignores SIGPIPE, with a 30 s timeout and a 1024-byte cap. It asserts that the run fails without timing out, keeps at most 1024 bytes, reports the cap, and ends within 1 s. That is under the reap's 1 s grace, so the test fails if the kill at the cap is removed (the run then takes about 1.06 s, or about 2.09 s with no kill at all).changelog.d/798.mdrecords the change under### Security.feat(release): v0.2.32 (#1516)