[GH-ISSUE #5777] Sandbox-denied sensitive writes in error-tolerant compound bash commands count as applied mutations #3193

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

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

Originally assigned to: @kolacheee on GitHub.

In one sentence: the shell sandbox silently blocks writes to sensitive paths, and an error-tolerant compound bash command swallows that failure and exits 0, so the verification guard counts a mutation the sandbox guaranteed did not happen.

The gap

Another #5756-class hole on the bash path. On Linux the sandbox ro-binds every sensitive path (package.json, .github/workflows/, win/installer/, launcher files); on macOS it emits (deny file-write* ...) for them (workspace-shell-sandbox.ts). A command like sed -i 's/old/new/' package.json; echo done fails the write but exits 0 via the trailing statement - common LLM shell style (cmd || true, multi-statement scripts). commandBash judges success by exit code alone, bashLooksMutating matches sed -i, and isAppliedWorkspaceMutation counts it applied. A later successful read resolves the round "verified" and Mari's "I bumped the version" claim passes while the file is byte-identical.

This also sidesteps the sensitive-change approval flow's visibility: the user never even sees a staged approval card - the write just silently didn't happen.

Single simple commands mostly fail loudly (non-zero exit), so this needs an error-tolerant compound command - reachable in practice but not on every run.

Fix direction

Options, roughly in order of strength: have the sandbox report write-denials on sensitive paths in a structured way commandBash can surface (turning the silent denial into a loud per-command failure or a staged-change handoff); or scan sandbox stderr for the denial and mark the result accordingly; or teach bashLooksMutating-positive commands touching sensitive paths to route through the write/edit staging flow instead of the sandbox.

Found during the adversarial review for #5775; pre-existing, not introduced there.

Originally created by @kolacheee on GitHub (Sep 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5777 Originally assigned to: @kolacheee on GitHub. **In one sentence:** the shell sandbox silently blocks writes to sensitive paths, and an error-tolerant compound bash command swallows that failure and exits 0, so the verification guard counts a mutation the sandbox guaranteed did not happen. ## The gap Another #5756-class hole on the bash path. On Linux the sandbox ro-binds every sensitive path (package.json, `.github/workflows/`, `win/installer/`, launcher files); on macOS it emits `(deny file-write* ...)` for them (workspace-shell-sandbox.ts). A command like `sed -i 's/old/new/' package.json; echo done` fails the write but exits 0 via the trailing statement - common LLM shell style (`cmd || true`, multi-statement scripts). `commandBash` judges success by exit code alone, `bashLooksMutating` matches `sed -i`, and `isAppliedWorkspaceMutation` counts it applied. A later successful read resolves the round "verified" and Mari's "I bumped the version" claim passes while the file is byte-identical. This also sidesteps the sensitive-change approval flow's visibility: the user never even sees a staged approval card - the write just silently didn't happen. Single simple commands mostly fail loudly (non-zero exit), so this needs an error-tolerant compound command - reachable in practice but not on every run. ## Fix direction Options, roughly in order of strength: have the sandbox report write-denials on sensitive paths in a structured way commandBash can surface (turning the silent denial into a loud per-command failure or a staged-change handoff); or scan sandbox stderr for the denial and mark the result accordingly; or teach `bashLooksMutating`-positive commands touching sensitive paths to route through the write/edit staging flow instead of the sandbox. Found during the adversarial review for #5775; pre-existing, not introduced there.
bsakaguchi 2026-10-21 06:00:24 +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#3193
No description provided.