zara-shell: reject scalar policy collections before root resolution #110

Closed
opened 2026-09-08 02:02:59 +00:00 by nsaspy · 0 comments
Owner

Problem

After element validation, CommandPolicy can still accept scalar iterable containers. In particular allowed_roots="/tmp" iterates as "/", "t", "m", "p"; ShellRunner then resolves / as an allowed root and can accidentally widen cwd confinement to the whole filesystem.

The public plugin currently constructs tuples safely, but CommandPolicy is itself a reusable security boundary and must fail closed on malformed callers.

Slice

  • deterministic RED coverage for scalar/string collections at the policy boundary;
  • require the intended collection shapes before validating elements;
  • preserve existing configured plugin behavior;
  • full exact-head compatibility, registry, plugin and Nix gates before merge.

Security/correctness slice within #5. Core cancellation remains separate.

## Problem After element validation, `CommandPolicy` can still accept scalar iterable containers. In particular `allowed_roots="/tmp"` iterates as `"/"`, `"t"`, `"m"`, `"p"`; `ShellRunner` then resolves `/` as an allowed root and can accidentally widen cwd confinement to the whole filesystem. The public plugin currently constructs tuples safely, but `CommandPolicy` is itself a reusable security boundary and must fail closed on malformed callers. ## Slice - deterministic RED coverage for scalar/string collections at the policy boundary; - require the intended collection shapes before validating elements; - preserve existing configured plugin behavior; - full exact-head compatibility, registry, plugin and Nix gates before merge. Security/correctness slice within #5. Core cancellation remains separate.
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
nsaspy/zara-plugins#110
No description provided.