Skip to content

MXC 0.7 processContainer: granted filesystem paths unusable — absolute paths doubled to C:\C:\..., writes false-succeed #1146

Description

@samanthamsong

Summary

On the Windows Node (MXC 0.7 processContainer backend, Bind Filter/BFS), folders granted as read/write in the sandbox settings page (e.g. Downloads, Documents) are unusable inside the container. Root cause appears to be a path-normalization bug, not a policy/allowlist choice. Writes report false success, risking silent data loss.

Environment

  • Host: Windows Node paired to a WSL gateway (gateway has no /mnt/c; all FS work routes to node)
  • Backend: Windows MXC 0.7 processContainer (wxc-exec.exe, Bind Filter/BFS)
  • Sandbox settings: Downloads granted read/write

Verified, reproducible symptoms

  1. Absolute-path doubling (100% repro): attrib "C:\Users\<user>\Downloads" returns Path not found - C:\C:\Users\<user>\Downloads. Same for Documents, Desktop, and C:\Windows. The backend prepends container root C:\ to already-absolute paths.

  2. Granted folder, three different failures: for %USERPROFILE%\Downloads: if exist reports MISSING; echo x > ...\t.txt returns exit 0; type ...\t.txt returns "syntax is incorrect"; dir ... returns "Access is denied".

  3. Relative write false-success: echo hi > rel.txt returns exit 0, but attrib rel.txt returns "Path not found" for the container CWD path.

  4. PowerShell output swallowed: cmd /c echo HELLO works; powershell -NoProfile -Command "Write-Output 'X'" returns only DACL-recovery stderr, no stdout. Source appears to be wxc-host-prep.exe / filesystem_dacl.rs managing the \Device\Null descriptor and erroring with GetNamedSecurityInfoW: WIN32_ERROR(2) on its own temp dirs.

  5. Hard timeout on \\?\-prefixed and forward-slash (C:/...) paths.

Config model (from wxc-exec.exe strings)

Keys: readwritePaths, readonlyPaths, deniedPaths, least_privilege_mode, containment. Filesystem is default-deny ("Paths are denied by default unless granted via readwritePaths or readonlyPaths"). Binary also carries a pwsh caveat ("add ... to readonlyPaths ... or upgrade to pwsh 7.7+") and a ReFS/Dev Drive warning ("Bind Filter (BFS) does not work correctly on ReFS volumes"). Intended behavior: granted folders go into readwritePaths and become usable. The defect is that they don't.

Root cause (hypothesis)

Path-normalization/prefix-join bug in the processContainer Bind Filter: already-absolute C:\... paths get re-rooted against the container root (C:\C:\...), and granted mounts aren't registered for stat/read even when writes are redirected. Net: readwritePaths grants never resolve inside the container.

Impact

  • Granted folders (Downloads/Documents) silently inaccessible.
  • Writes return exit 0 but data isn't retrievable at the expected path: silent data-loss risk.
  • Agents can't distinguish "file absent" from "path mangled"; PowerShell node work returns no output.

Requested fixes

  1. Stop re-rooting already-absolute C:\... paths (fix C:\C:\... doubling).
  2. Make readwritePaths/readonlyPaths grants actually stat/list/read/write inside the container.
  3. Make writes to unmounted paths fail loudly instead of exit 0.
  4. Fix DACL-recovery noise so PowerShell stdout returns like cmd.
  5. Handle \\?\ / forward-slash paths without hanging.
  6. Confirm settings-page grants are written into MXC readwritePaths/readonlyPaths and surface active mounts.

Repro (single-line cmd on node; MXC 0.7 rejects CR/LF in commands)

  1. attrib "C:\Users\<user>\Downloads" - observe C:\C:\... in error.
  2. echo x > "%USERPROFILE%\Downloads\t.txt" (exit 0), then type / dir same path - syntax error / access denied.
  3. echo hi > rel.txt then attrib rel.txt - write ok, stat "Path not found".
  4. cmd /c echo HELLO vs powershell -NoProfile -Command "Write-Output 'X'" - cmd works, powershell stdout swallowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:data-lossThis issue is about lost, corrupted, or silently dropped user/session/config data.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions