Skip to content

Downlevel Support - Grant FILE_GENERIC_EXECUTE in readwrite/readonly path ACEs#448

Merged
MGudgin merged 1 commit into
mainfrom
user/gudge/add_execute_to_acls
May 28, 2026
Merged

Downlevel Support - Grant FILE_GENERIC_EXECUTE in readwrite/readonly path ACEs#448
MGudgin merged 1 commit into
mainfrom
user/gudge/add_execute_to_acls

Conversation

@MGudgin

@MGudgin MGudgin commented May 28, 2026

Copy link
Copy Markdown
Member

The previous masks (R | W | DELETE for rw, R for ro) lacked FILE_EXECUTE — which on directory objects is the same bit (0x20) as FILE_TRAVERSE. SetCurrentDirectoryW opens the target with FILE_TRAVERSE, so any AppContainer child runtime-chdir'ing into a granted directory hit ERROR_ACCESS_DENIED.

SeChangeNotifyPrivilege (Bypass Traverse Checking) only skips the per-component FILE_TRAVERSE check on intermediate path elements; the leaf opened by SetCurrentDirectoryW is still access-checked, so the privilege the AppContainer token does carry does not help here.

Read and write workloads were unaffected because they only need bits already in the mask. The fix unblocks runtime chdir into a granted directory from any caller that bottoms out in SetCurrentDirectoryW — cmd cd /d, node process.chdir, python os.chdir, git's internal chdir, etc.

Higher-level shells with their own path-validation layers are not addressed:

  • pwsh Set-Location walks ancestor directories through the FileSystemProvider, requiring FILE_LIST_DIRECTORY on C:\ and every intermediate — orthogonal to the chdir primitive.
  • git -C chdir's successfully with this fix but then fails at mingw_getcwd's GetFinalPathNameByHandleW (VOLUME_NAME_DOS needs Mount Point Manager query access an AppContainer doesn't carry); tracking upstream in git-for-windows.
Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings May 28, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates AppContainer DACL access masks so granted filesystem paths include the execute/traverse bit needed for SetCurrentDirectoryW to chdir into allowed directories.

Changes:

  • Adds FILE_GENERIC_EXECUTE to read-write and read-only path ACE masks.
  • Updates compile-time mask assertions.
  • Extends the access mask layout unit test to verify the FILE_TRAVERSE/FILE_EXECUTE bit is present.
Show a summary per file
File Description
src/wxc_common/src/filesystem_dacl.rs Widens AppContainer filesystem ACE masks and updates related assertions/tests.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread src/wxc_common/src/filesystem_dacl.rs
Comment thread src/wxc_common/src/filesystem_dacl.rs
@MGudgin
MGudgin force-pushed the user/gudge/add_execute_to_acls branch from 8e1ca70 to 1c9820f Compare May 28, 2026 18:52
@MGudgin
MGudgin force-pushed the user/gudge/add_execute_to_acls branch from 1c9820f to fbd3312 Compare May 28, 2026 20:29
@MGudgin

MGudgin commented May 28, 2026

Copy link
Copy Markdown
Member Author

Run ADO Build please

@MGudgin

MGudgin commented May 28, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

The previous masks (R | W | DELETE for rw, R for ro) lacked
FILE_EXECUTE — which on directory objects is the same bit (0x20) as
FILE_TRAVERSE. SetCurrentDirectoryW opens the target with
FILE_TRAVERSE, so any AppContainer child runtime-chdir'ing into a
granted directory hit ERROR_ACCESS_DENIED.

SeChangeNotifyPrivilege (Bypass Traverse Checking) only skips the
per-component FILE_TRAVERSE check on *intermediate* path elements;
the leaf opened by SetCurrentDirectoryW is still access-checked, so
the privilege the AppContainer token does carry does not help here.

Read and write workloads were unaffected because they only need bits
already in the mask. The fix unblocks runtime chdir into a granted
directory from any caller that bottoms out in SetCurrentDirectoryW —
cmd cd /d, node process.chdir, python os.chdir, git's internal chdir,
etc.

Higher-level shells with their own path-validation layers are not
addressed:
  * pwsh Set-Location walks ancestor directories through the
    FileSystemProvider, requiring FILE_LIST_DIRECTORY on C:\ and
    every intermediate — orthogonal to the chdir primitive.
  * git -C <dir> <cmd> chdir's successfully with this fix but then
    fails at mingw_getcwd's GetFinalPathNameByHandleW
    (VOLUME_NAME_DOS needs Mount Point Manager query access an
    AppContainer doesn't carry); tracking upstream in
    git-for-windows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MGudgin
MGudgin force-pushed the user/gudge/add_execute_to_acls branch from fbd3312 to 9334b65 Compare May 28, 2026 22:43
@MGudgin

MGudgin commented May 28, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@MGudgin
MGudgin merged commit fbb2c1e into main May 28, 2026
20 checks passed
@MGudgin
MGudgin deleted the user/gudge/add_execute_to_acls branch May 28, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants