security: --forgetoken interpolated into bash -c argv at provisioning (multiuser.nu:574, 579) #108
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#108
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?
Summary
When the admin runs
multi_user_add alice --forgetoken <T>, the token is interpolated intosudo bash -c "... FORGE_TOKEN=<T> ..."strings that launchinstall.shandsecrets_sync. While those subprocesses run (seconds), the token is visible inps auxe//proc/<pid>/cmdlineto any user on the host, and lands in the admin's shell history and sudo logs.Location
tools/modules/installers/multiuser.nu:install.shinvocation)secrets_syncinvocation)Proposed fix
Pass secrets via env to the sudo child, not via string interpolation. Set them in nushell's env before the sudo call, and use
--preserve-envso sudo doesn't strip them across the privilege drop:Drop the
forge_envstring-prefix construction entirely. Same pattern for thesecrets_syncinvocation.Impact
Medium — transient leak during provisioning, visible to any user doing
ps auxeconcurrently. Lower blast radius than #106 because it only happens duringmulti_user_add, not at every start/stop cycle.