Repository navigation
windows: start a sandbox from session 0 without a session folder grant - #793
Open
TurtIeSocks wants to merge 1 commit into
Open
TurtIeSocks wants to merge 1 commit into
TurtIeSocks wants to merge 1 commit into
Conversation
From session 0 (ssh, a scheduled task set to run whether logged on or not), every launch failed before the runner started: grant_sandbox_on_session_bno opened \Sessions\0\BaseNamedObjects, which does not exist, and failed with NTSTATUS 0xC0000034. Session 0's named objects live in the global \BaseNamedObjects instead. That folder must not be granted: every service shares it, and only SYSTEM and Administrators can write its DACL. It also needs no grant. Its DACL already gives Everyone QUERY | TRAVERSE | CREATE_OBJECT | CREATE_SUBDIRECTORY (0x2000F), and the lockdown token keeps Everyone enabled, so msys2's per-DLL subdirectory, which the grant exists for, can already be made there. So grant_sandbox_on_session_bno returns without opening anything in session 0. broker_session() reads the session once for it and open_session_bno, and session_bno_path() holds the rule as a pure function with a test each way. Checked on Windows 11 ARM64 over ssh: cmd, Git Bash's sh and git run in the sandbox; a write outside the write roots and a read of a denied folder are refused; the proxy allows the allowed host, returns 403 for another, and a direct connection is blocked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
From session 0 (ssh, a task set to run whether logged on or not) every launch fails with
NtOpenDirectoryObject(\Sessions\0\BaseNamedObjects, READ_CONTROL|WRITE_DAC): NTSTATUS 0xC0000034. Session 0's objects live in the global\BaseNamedObjects, which every service shares, so it shouldn't be granted. It doesn't need to be: Everyone already holdsCREATE_OBJECT | CREATE_SUBDIRECTORYthere.grant_sandbox_on_session_bno + if broker_session() == 0: return Ok open \Sessions\<ts>\BaseNamedObjects, add the srt-sandbox ACEEvidence
Windows 11 ARM64, over ssh (session 0), through a tool that vendors this srt-win source:
After:
cmd, Git Bashshandgitrun in the sandbox. A write outside the write roots and a read of a denied folder are refused, the proxy returns 403 for a host not on the allowlist, and a direct connection is blockedcargo test --lib: 191 passed.profile::tests::objects_the_caller_may_not_change_are_classed_and_do_not_stop_the_grantfails on that machine on main too.Merge Danger
Door: two-way
Blast Radius: session 0 launches only
Disclaimer: Code was generated by Claude 🤖 - reviewed and tested by a human 🐢