[GH-ISSUE #5892] Sandbox scan residuals: package-store trees and macOS teardown survivors #3253

Closed
opened 2026-10-21 06:01:16 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Sep 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5892

Originally assigned to: @kolacheee on GitHub.

In one sentence: two documented residuals from #5786's post-execution scan (PR #5891) that were consciously left open, so they have a tracked home instead of living only in PR prose.

1. Package-store trees are outside the scan

The scan deliberately skips node_modules, .pnpm, and .pnpm-store (cost: they dwarf the rest of the workspace, and the scan runs twice per bash command). A command can therefore still plant a ready-made node_modules/<pkg>/ — package.json plus code that executes on the server's next require. Mitigating context: writing there was always sandbox-permitted (builds need it), and the review floor defends the manifests that control what legitimately gets installed. But planted store content is an arbitrary-code vector the sandbox does not answer today. Possible directions: a cheap store-integrity check against the lockfile on boot; scanning only store paths the run's own output mentions; or accepting and documenting it as the sandbox's boundary.

2. macOS teardown survivors can write after the scan

Bubblewrap on Linux gives the sandbox --die-with-parent and --unshare-all, so nothing outlives teardown. Seatbelt on macOS has no PID-namespace equivalent: PR #5891 adds SIGKILL escalation for the direct child, but a backgrounded grandchild (or anything that survives the escalated kill) can still write a sensitive file after the post-execution scan walks. Scope precisely: "any process surviving seatbelt teardown", not just backgrounded grandchildren. Possible directions: process-group kill (spawn with detached + negative-pid kill), a delayed second scan sweep, or accepting the platform limitation with the current documentation.

Neither residual weakens what #5891 ships — the reported #5786 class (new sensitive-by-name files under normal command shapes) is closed on all platforms, with Linux fully sealed.

Originally created by @kolacheee on GitHub (Sep 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5892 Originally assigned to: @kolacheee on GitHub. **In one sentence:** two documented residuals from #5786's post-execution scan (PR #5891) that were consciously left open, so they have a tracked home instead of living only in PR prose. ## 1. Package-store trees are outside the scan The scan deliberately skips `node_modules`, `.pnpm`, and `.pnpm-store` (cost: they dwarf the rest of the workspace, and the scan runs twice per bash command). A command can therefore still plant a ready-made `node_modules/<pkg>/` — `package.json` plus code that executes on the server's next `require`. Mitigating context: writing there was always sandbox-permitted (builds need it), and the review floor defends the *manifests* that control what legitimately gets installed. But planted store content is an arbitrary-code vector the sandbox does not answer today. Possible directions: a cheap store-integrity check against the lockfile on boot; scanning only store paths the run's own output mentions; or accepting and documenting it as the sandbox's boundary. ## 2. macOS teardown survivors can write after the scan Bubblewrap on Linux gives the sandbox `--die-with-parent` and `--unshare-all`, so nothing outlives teardown. Seatbelt on macOS has no PID-namespace equivalent: PR #5891 adds SIGKILL escalation for the direct child, but a backgrounded grandchild (or anything that survives the escalated kill) can still write a sensitive file *after* the post-execution scan walks. Scope precisely: "any process surviving seatbelt teardown", not just backgrounded grandchildren. Possible directions: process-group kill (`spawn` with `detached` + negative-pid kill), a delayed second scan sweep, or accepting the platform limitation with the current documentation. Neither residual weakens what #5891 ships — the reported #5786 class (new sensitive-by-name files under normal command shapes) is closed on all platforms, with Linux fully sealed.
bsakaguchi 2026-10-21 06:01:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3253
No description provided.