Skip to content

desktop: private HOME and XDG dirs for managed desktop sessions #150

Closed

Description

@ElbertePlinio

Managed desktop sessions launch apps with the caller's real HOME, XDG_CONFIG_HOME, XDG_DATA_HOME and XDG_CACHE_HOME (createIsolatedDesktopEnvironment in packages/desktop-linux/src/environment.ts copies the source environment and overrides only display, Wayland, runtime dir, D-Bus and Node variables). The browser lab already isolates HOME; the #118 audit and the 0.4.0 release passes worked around this with bubblewrap. Native apps driven by an agent must not read or write the user's real configuration and data.

  • Give every new desktop session a fresh HOME plus config, data, cache and state dirs under the session directory, applied by desktop_launch, desktop_exec, desktop env and the takeover path
  • Add an explicit opt-in to inherit the real home (CLI flag and MCP field), refused when a human lease is live, and record the choice in session status and the evidence manifest
  • Extend packages/desktop-linux/test/isolation.test.ts to assert the private home and dirs; keep the Wayland poison, runtime dir and D-Bus assertions
  • Document the boundary in README and SECURITY.md; never migrate or delete anything in the real home
  • Separate final reviewer

Part of #118. Refs #73, #104.

Implementation started as the first dependency of #118, on branch feat/desktop-private-home from the released 0.5.0 source. Scope is session-local HOME/XDG defaults, explicit inherited-home consent, truthful status/evidence, takeover guards, regression tests and boundary documentation. Existing sessions must not be silently relabeled private, and environment isolation must not be presented as an OS filesystem/network sandbox. Changes stay uncommitted through checks and two independent security reviews; the PR will link this issue with Closes. No later desktop tools or release publication are included in this slice.

First implementation is uncommitted. A new synthetic regression exposed a blocker in the existing core permit path: a planted session-directory symlink can redirect permit writes outside the session before isolation validation. Parent reproduced it. The bounded fix now includes core takeover storage, followed by the same required checks and two independent security reviews; no merge or release is approved yet. An earlier new-test argument error also routed five synthetic evidence cases to default runner storage. The invocation is corrected; the extent is being bounded without deleting records or claiming a clean host. Future test runs will additionally use disposable outer HOME/XDG/PICKFORGE storage.

Independent reviews are complete on the first full diff. Blocking corrections remain for ownership throughout recursive cleanup, file-handle-bound atomic permission updates, stable permit/session identity during takeover coordination, and inaccurate consent help text. These are one focused defensive repair batch, including the shared atomic-write helper; no unrelated feature work or publication. Existing source/checks/failures remain preserved, followed by focused re-review and required CI before any merge.

Current implementation and both independent reviews are complete on the submitted tree. PR #171 closes this issue after required CI and merge. Local verification is1808passes/4knownskips through combined unchanged-source and corrected-file evidence, not a fresh full-suite run. The earlier five synthetic projects/20files remain unchanged and preserved. Marker retirement is a non-blocking follow-up in #170. Passive watch remains non-pausing; watch --control holds the pausing lease.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions