Decide how the root chown walks treat an agent-controlled worktree #1560

Open
opened 2026-10-27 13:40:53 +00:00 by sam · 0 comments
Owner

Goal

The chown walks that run as root over a worktree the agent controls either cannot
be steered outside that tree, or the residual risk is recorded as accepted.

Evidence

internal/agentexec/harness_proc_unix.go:116, internal/app/agentworker/task_execution.go:121 and
internal/worktree/worktree.go:364,372 Lchown every entry of a worktree the agent owns while running as
root. Lchown does not follow symlinks, but the walk itself is not root-scoped, so
a directory swapped during the walk chowns outside the tree. os.Root does not
cover chown, so there may be no small fix. gosec G122 flags all four.

Stop when

[ ] Each walk is confined or root-scoped, or the decision to accept the race is
written here and the bead is closed.


Imported from beads archie-core-rzh5 · GitHub #1554 · type task · priority P2 · created 2026-10-08

## Goal The chown walks that run as root over a worktree the agent controls either cannot be steered outside that tree, or the residual risk is recorded as accepted. ## Evidence internal/agentexec/harness_proc_unix.go:116, internal/app/agentworker/task_execution.go:121 and internal/worktree/worktree.go:364,372 Lchown every entry of a worktree the agent owns while running as root. Lchown does not follow symlinks, but the walk itself is not root-scoped, so a directory swapped during the walk chowns outside the tree. os.Root does not cover chown, so there may be no small fix. gosec G122 flags all four. ## Stop when [ ] Each walk is confined or root-scoped, or the decision to accept the race is written here and the bead is closed. --- _Imported from beads `archie-core-rzh5` · GitHub #1554 · type task · priority P2 · created 2026-10-08_
sam added the mediumtask labels 2026-10-27 13:40:53 +00:00
sam self-assigned this 2026-10-27 13:40:53 +00:00
sam added the deferred label 2026-11-15 17:26:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1560