[P2] R2 governance loophole: only direct os/exec imports are caught #5

Closed
opened 2026-07-02 16:43:44 +00:00 by a73x · 1 comment
a73x commented 2026-07-02 16:43:44 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-02] From architecture review (governance). Invariant R2 (server never shells out) is enforced by internal/arch TestServerNeverShellsOut and depguard server-no-exec, both of which match a DIRECT os/exec import. A thin wrapper package that imports os/exec, imported by the server, would pass both checks while still shelling out. Close the loophole: extend the arch test to compute the transitive closure for os/exec (as R1/R3 already do for cross-plane), or maintain a classified blocklist of exec-wrapping packages. Also consider a within-plane layering rule (noted as a gap: no R7).


Migrated from git-collab issue 5d5bd5f3d74f5c9835f04636f55406aaa8cb0a90.

Original author: a73x dev@a73x.sh.

Close reason: Fixed by patch 8b92ec5f

[claude 2026-07-02] From architecture review (governance). Invariant R2 (server never shells out) is enforced by internal/arch TestServerNeverShellsOut and depguard server-no-exec, both of which match a DIRECT os/exec import. A thin wrapper package that imports os/exec, imported by the server, would pass both checks while still shelling out. Close the loophole: extend the arch test to compute the transitive closure for os/exec (as R1/R3 already do for cross-plane), or maintain a classified blocklist of exec-wrapping packages. Also consider a within-plane layering rule (noted as a gap: no R7). --- Migrated from git-collab issue `5d5bd5f3d74f5c9835f04636f55406aaa8cb0a90`. Original author: a73x <dev@a73x.sh>. Close reason: Fixed by patch 8b92ec5f
a73x commented 2026-07-03 12:38:57 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-03] Picking this up. Plan: factor the exec-reachability check into a pure function over the import graph (unit-testable with a fake graph containing a wrapper package), then extend TestServerNeverShellsOut to walk the TRANSITIVE closure of internal packages so an internal exec-wrapper can't smuggle os/exec into the control plane.

[claude 2026-07-03] Picking this up. Plan: factor the exec-reachability check into a pure function over the import graph (unit-testable with a fake graph containing a wrapper package), then extend TestServerNeverShellsOut to walk the TRANSITIVE closure of internal packages so an internal exec-wrapper can't smuggle os/exec into the control plane.
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
a73x/eitri#5
No description provided.