fix(windows): accept AppContainer capability grants on runtime ancestors - #1447
fix(windows): accept AppContainer capability grants on runtime ancestors#1447mlandolfi90 wants to merge 2 commits into
Conversation
Sandboxing tools stamp the user profile's AppData with capability ACEs (S-1-15-3-…) holding write rights. The ancestor DACL walk classified them as untrusted grants, so cbm_daemon_ipc_endpoint_new returned NULL and every process on such a machine died at startup with 'secure daemon endpoint could not be created'. A capability ACE grants only to AppContainer processes provisioned by the same user's tooling, and the runtime directory itself still demands the exact-user owner plus a protected DACL. Accept capability SIDs on ancestor components only; the final directory validation is unchanged. Observed in the field: AppData carrying two capability ACEs with mask 0x000d0152 (FILE_DELETE_CHILD, DELETE, WRITE_DAC among them) stamped by an agent-sandbox provisioner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: mlandolfi90 <mlandolfi90@users.noreply.github.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
The bundle contract pins the ancestor validation call by literal text, so adding the capability parameter turns it red on every platform (the check reads source, it does not compile). Update the needle, and use the opportunity to pin what actually matters about this change: the ancestor call passes true, the final runtime directory still passes false, and the capability test exists. A future edit that let a capability ACE satisfy the published runtime directory now fails this contract. Signed-off-by: mlandolfi90 <mlandolfi90@users.noreply.github.com>
|
CI update — the platform-wide red was real and mine, and it is worth naming precisely because it is a good guard.
"win_file_security_secure(security, directory, false, mutation)",Adding the capability parameter changed that text, so the contract failed on Linux and macOS too — the check reads the source rather than compiling it. That is the guard doing its job: it is exactly the line that decides how much an ancestor is allowed to grant, and it should not move quietly. I have pushed an update to the needle, and used the occasion to pin the property this PR actually needs to be true rather than just the call shape: "win_file_security_secure(security, directory, false, mutation, true)",
"win_private_mutation_rights(), false)",
"win_sid_is_app_capability",The middle one is the important addition: it pins that If you would rather this guard not be touched by a contributor PR at all, say so and I will drop the test commit and let you land the needle change yourself. The remaining 🤖 Generated with Claude Code |
Symptom
On an ordinary Windows 11 developer machine, every CBM process died at startup:
No CBM process was competing, and the same machine had run a daemon for days on an older build. The cause is environmental and, I suspect, increasingly common: an agent sandbox (Codex) had stamped the user's
AppDatawith capability ACEs.win_private_directory_tree_securewalks every ancestor of the runtime directory and refuses any mutation-granting ACE whose SID is not the exact user, SYSTEM, Administrators, TrustedInstaller, CreatorOwner (inherit-only) or OWNER RIGHTS. A capability SID matches none of them, socbm_daemon_ipc_endpoint_newreturns NULL and the process exits — including plain--version-adjacent paths that construct an endpoint.Why I think accepting them on ancestors is sound
A capability SID (
S-1-15-3-…,SECURITY_APP_PACKAGE_AUTHORITY) grants only to AppContainer processes that the same user's tooling provisioned. It cannot be used by another account, and it does not confer rights on a normal process. This is the same shape of argument the OWNER RIGHTS acceptance in 8b4e0fb already makes: the grant is reachable only by the party the walk is protecting.The relaxation is deliberately narrow:
win_directory_component_securepassesancestor_capability_ok = true.win_runtime_directory_securepassesfalse, so it still demands the exact-user owner and a protected DACL, and still re-stamps it.15) and the capability RID class (3) explicitly, so it cannot widen to otherS-1-15-*classes.Note on the trust model
This does move a trust boundary, so I understand if you would rather discuss it in an issue before reviewing code — happy to convert. I am also open to a narrower shape if you prefer one: gating it behind an opt-in, or restricting acceptance to ancestors that lie inside the user's own profile.
What I would push back on is leaving it as-is: the failure gives the user one sentence with no cause, and the only remedies available to them are removing ACEs their sandbox depends on, or not running CBM.
🤖 Generated with Claude Code