You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: sandbox user can't stat ancestors of allowed folders, and placeholder deny targets are left in the caller's cwd #657
Environment: Windows 11 x64, sandbox-runtime 0.0.77, srt-win built from main plus #648.
1. No read-attributes on ancestors of allowed folders
When an allowed folder sits two or more levels under the user profile (e.g. C:\Users\me\code\repo), srt-sandbox can open files inside it but can't stat the folders in between (C:\Users\me\code). Anything that stats each ancestor fails:
git in a repo there: fatal: failed to stat 'C:\Users\me\code': Permission denied
Node's JS fs.realpathSync, which lstats every path component: EPERM
Granting it by hand with icacls C:\Users\me\code /grant srt-sandbox:(RA) fixes both. As far as I can tell vendor/srt-win-src/src/acl.rs only stamps ACEs on the granted paths, so nothing gives their ancestors read-attributes.
Ask: grant a non-inheritable FILE_READ_ATTRIBUTES ACE on each ancestor of an allowed path that srt-sandbox can't already stat, and remove it on restore. Read-attributes doesn't expose file contents or directory listings.
2. Placeholder deny targets land in the caller's cwd and stay there
For a deny target that doesn't exist, acl stamp creates a placeholder so it has something to put the deny ACE on (dist/sandbox/windows-sandbox-utils.js around line 950). Relative deny paths resolve against process.cwd() (dist/sandbox/sandbox-utils.js:393 and :397), so denying .git/hooks, .gitconfig and .gitlab-ci.yml leaves an empty .git\hooks folder and two empty files in whatever folder the process started in. They're still there after the session ends.
The empty .git folder is the bigger problem: tools that look for a .git entry treat the folder as a repo, and git then fails with not a git repository.
Ask: remove placeholders that srt-win created when the session restores the ACLs, or let callers opt out of creating them.
I'm holding part 2 until #579 lands, since it rewrites the same deny-path code. #579 already skips missing paths for the built-in deny list. The denies in my report came in through filesystem.denyWrite though, and #579's README says placeholders for those are permanent by design.
Once #579 merges, should srt-win remove the placeholders it created when the session restores, or let callers opt out of creating them? If this is working as intended, I'm happy to close part 2. Thanks!
Activity
karljamoralin commentedon Oct 7, 2026
Part 1 is up for review in #661.
I'm holding part 2 until #579 lands, since it rewrites the same deny-path code. #579 already skips missing paths for the built-in deny list. The denies in my report came in through
filesystem.denyWritethough, and #579's README says placeholders for those are permanent by design.Once #579 merges, should srt-win remove the placeholders it created when the session restores, or let callers opt out of creating them? If this is working as intended, I'm happy to close part 2. Thanks!