Files
codex/codex-rs/windows-sandbox-rs
viyatb-oai c6ad6f33eb Restrict Windows sandbox default object access to the logon session (#47361)
## Why

Shared filesystem capabilities must not grant access to another logon session's processes, threads, or IPC objects. A shared account's implicit owner rights can also allow another logon to rewrite an object's DACL.

## What changed

- Grant full access in the token's default DACL only to the runner's logon SID, removing grants to Everyone and capability SIDs.
- Add an `OWNER RIGHTS` entry granting only `READ_CONTROL` to suppress the owner's implicit `WRITE_DAC` access.
- Close the new token handle if default DACL or privilege setup fails.

## Testing

Add a Windows `AccessCheck` regression test verifying that process memory, thread creation, termination, query, and DACL modification rights remain available to the creating logon but are denied to a simulated other logon sharing the same owner and capability.

GitOrigin-RevId: 94608466ee1b461fe10db1866e80b3988119bdfc
2026-09-22 20:46:58 +00:00
..