toolchain: the supervised nix install's pkexec dies pre-auth in nix-develop envs (same defect as the primer's Finding M) #340
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#340
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/toolchain/installer.go:76runsi.run(ctx, pkexec, "sh", "-c", OperatorInstallCommand())with no SHELL sanitization. pkexec validates the invoking environment's SHELL against/etc/shellsBEFORE prompting;nix developexports a store-path bash that is never listed, so the supervised install exits 127 pre-auth in any nix-develop environment — the identical defect Finding M fixed for the primer (commit9fcaf22), confirmed by grep as the only other production pkexec invocation.Fix shape: mirror
prime.go'selevatedPrime(env SHELL=/bin/shcarried on the invocation viaenv, no nested re-quoting) with the same style of discriminating test (recorded invocation asserts the sanitization sits before pkexec; red pre-fix). Unlike priming, the installer fails LOUD, so severity is lower — but it is the consent-gated install path (ADR 0125), and a 127 there blocks a nix-less host's founding. Consider whether the Finding N elevation bound belongs here too (an install prompt is NOT an optimisation — probably not; say why in the fix).Fixed in
8b053f0(onorigin/main).internal/toolchain/installer.go:76now runs the supervised install asenv SHELL=/bin/sh pkexec sh -c …instead of a barepkexec sh -c …. pkexec validates the calling process's$SHELLagainst/etc/shellsbefore it prompts, and undernix develop$SHELLis a store-path bash that is never listed — so the unsanitised call exited 127 pre-auth on any nix-develop host, killing the consent-gated founding of a nix-less machine (ADR 0125) before the operator could authenticate. CarryingSHELL=/bin/shviaenv(no nested re-quoting, sitting before pkexec so pkexec reads it from its own environment) reaches the prompt.Deliberately no elevation-timeout bound (the Finding N question in the brief): this is the consent-gated install itself, not a best-effort optimisation — the operator's authentication is the point, not a cost to cap — and it already fails loud on a non-zero exit (ADR 0100). Rationale recorded in the code comment.
Evidence:
TestInstallSanitisesShellBeforePkexec(records the invocation, asserts the sanitisation sits before pkexec; red before the fix, per the manifest's discriminating style); fullinternal/toolchain+internal/foundingsuites green; gofmt/build clean; the repo pre-push hook ran the suites green on push.Note on the brief's premise: this repo has no
prime.go/primer (the "Finding M fix (commit9fcaf22)" it cites to mirror is absent frommainand all history — same phantom as #341). The defect and remedy here are self-contained, so the fix stands without it; the sibling hardening issue #341 (all-phantom) was routed toready-for-human.