Repository navigation
Description
Critical functional impact
On Windows, the native sandbox can become unable to start routine local tools after persistent protection DACLs reach the Windows ACL size limit. This blocked basic file reads, trivial shell output, and a Node kernel in a real working session. Repeated attempts waited for minutes without returning a usable result; work could not continue. This is a severe workflow outage, not merely slower model responses.
Fourteen codex-windows-sandbox-setup.exe processes were observed alive for roughly 7 minutes to 3 hours. CPU use was measured, not inferred: a later two-snapshot sample of another stalled setup helper recorded 1.906 CPU-seconds in 2.06 elapsed seconds, while it had been alive for 206 seconds. Earlier samples also showed CPU-time increases across multiple setup helpers. Their parent PIDs were recorded, so this report calls them lingering setup helpers, not proven orphan processes.
Environment and isolation
- Windows 11 Pro, build 26200, NTFS.
- Installed
codex-cli 0.160.0; nativeelevatedsandbox,workspace-write. - Intel i7-12700K, 20 logical CPUs, approximately 64 GiB RAM; approximately 30 GiB physical RAM remained available during capture.
- A shell command outside the sandbox completed immediately, while the sandboxed version and a Node kernel stalled.
- A local model-routing proxy answered five health probes, and a supported minimal streaming inference completed successfully in 2.84 seconds. This is a single-request check, not a broad inference benchmark; the failing shell/ACL path does not require an inference request.
- The workspace included the user profile. Do not infer that every project-sized workspace reproduces the entire startup delay.
No credentials, raw capability ledger, raw ACL descriptors, usernames, machine identifiers, project paths, or session content are attached.
Direct evidence: DACL capacity failure
A protected credential/cache directory had 908 distinct synthetic SID trustees, 1,819 ACEs, and a 65,464-byte DACL. For each trustee, Windows had an effective deny (0x130156, flags 0) and an inherit-only deny (0x40130156, flags OI|CI|IO). Sandbox logs repeatedly recorded this sanitized error:
deny ACE failed on <profile>\.aws: SetSecurityInfo failed for <profile>\.aws: 1340
Windows documents a maximum ACL size of 64 KiB. The .aws name is incidental: this is persistent ACL state on a protected directory, not an AWS service or AWS CLI failure.
Latest-source cause of avoidable ACE amplification
At upstream 4cedd0caac89f9fdcb5ad385e8093da5363d91c2, windows-sandbox-rs/src/acl.rs, DenyAceKind::mask() emits file-specific read/write rights and the corresponding generic bit. add_deny_ace() requests OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE.
Windows splits an inheritable ACE containing generic information into an effective ACE and an inherit-only ACE. The file-specific mask already contains the generic mapping. Keeping the generic bit unnecessarily doubles the ACE representation on directories and exhausts the finite DACL sooner.
This is a confirmed amplification mechanism, not a complete explanation for capability-SID lifecycle growth or all startup delays.
Deterministic manual Windows reproduction, without building Codex
Use two disposable directories. Construct a DACL containing the original inherited allow entries plus 1,000 inheritable DENY ACEs for unique synthetic SIDs. Do not use a real user's SID. Apply it with Windows/.NET DirectorySecurity and Set-Acl:
| Mask | SID count | Actual result |
|---|---|---|
Legacy 0x40130156 (`specific |
GENERIC_WRITE`) | 1,000 |
Specific 0x130156 |
1,000 | Success; 1,005 ACEs, 36,160 bytes in this fixture |
Separate native ACL probes compared read (0x120089) and write (0x130156) forms on the directory itself, existing child files/directories, and later-created nested descendants. Effective mapped denials matched. The specific form retained one ACE per SID after adding a second SID and after eight repeated native DACL writes.
This manually establishes both the failure and the proposed mitigation using the actual Windows ACL API behavior, without relying on a Rust build.
Recovery observations and limits
- Backing up and compacting equivalent per-SID deny pairs retained every trustee and the same effective self/descendant restrictions. The first compaction reduced 65,464 to 32,776 bytes.
- Subsequent setup appended new SID entries and saturated the DACL again; it did not simply undo compaction of the same trustees. A second compaction retained all 1,362 then-present trustees and reduced the DACL to 49,120 bytes. No historical trustee was deleted.
- Capacity restoration alone initially left a severe large-profile startup delay. The remaining path was directly confirmed as repeated inheritable DACL updates over a 132,175-file protected tree, with 508 of 529 current capability SIDs missing at first observation. The actual full-profile elevated session is now recovered after one equivalent-rights bulk ACL repair plus separate credential reconciliation. Detailed measurements and recurrence limits are in the follow-up.
- A separate multi-CODEX_HOME password collision was independently verified with
LogonUserW: both accounts failed with 1326 in one home while both succeeded in the other. One-time encrypted-record reconciliation restored both homes without changing Windows passwords or the target owner/DACL. This duplicates existing #40627, rather than establishing causation by DACL saturation. - A one-invocation
unelevatedsandbox in a small workspace successfully wrote and read a file. It was a diagnostic fallback, not a global configuration change or proof that the elevated path is repaired.
Requested engineering response
- Avoid redundant generic bits in file-system DENY ACEs and batch missing write-deny SIDs into one update per protected path; preserve the mapped specific rights and SID protections.
- Add a supported, transactional recovery/reconciliation path for already-large persistent ACLs without deleting valid capability protections.
- Bound setup waits and honor cancellation so timed-out callers do not leave setup helpers running indefinitely.
- Surface the offending path, API, error code, and ACL capacity in the tool result; silent multi-minute waits make the failure look like model/proxy latency.
- Investigate capability lifecycle/accumulation and broad-root ACL propagation independently.
Related: #41169 (capability lifecycle), #34889 (broad-root setup delays). This report adds a directly reproduced 64-KiB capacity failure and a verified ACE-amplification mitigation.
Validation disclosure
No successful Codex build, Rust regression execution, cargo check, or full test-suite run is claimed. A preliminary build attempt was stopped when the reporter requested manual-only validation. The proposed mask change was validated manually against Windows ACL APIs; source regression coverage is added for CI to run. It mitigates ACE amplification; it does not by itself migrate every historical ACL or resolve every setup/account problem.
References: Microsoft ACL size limit, Microsoft ACE inheritance rules, file generic-right mappings.
Activity
MeroZemory commentedon Oct 2, 2026
Additional directly measured helper lifetime/CPU evidence from the same incident (PIDs redacted):
These were not merely old idle processes. The two-snapshot measurement already included in the issue also demonstrated ongoing CPU-time growth. The stalled helpers were explicitly stopped during recovery; no Codex/OCX main process was terminated.
The focused mitigation has been manually verified: 1,000 generic write DENYs fail with Windows error 1340; 1,000 equivalent specific-only DENYs succeed at 36,160 bytes. The patch and unrun Rust regression source are available at MeroZemory@0144c578d4 . Upstream draft PR creation was attempted through GraphQL and REST, but GitHub denied CreatePullRequest for this account. No upstream PR exists yet.
This is not a claim of complete elevated-sandbox recovery. A profile-root startup wait and a separately verified sandbox-account password mismatch remain distinct concerns. A diagnostic one-invocation unelevated sandbox in a small workspace completed a file write/read in 0.409 seconds, but no global fallback configuration change has been made. No successful Codex build or Rust test run is claimed.
MeroZemory commentedon Oct 2, 2026
Duplicate/related-report triage follow-up:
The additional evidence in this report is the measured near-full 65,464-byte DACL, actual error 1340, the native 1,000-SID capacity comparison, measured CPU consumption by stalled setup helpers, and a focused specific-rights-only mitigation. SID lifetime/cleanup and general startup hangs still need separate investigation.
I searched open and closed issues/PRs and inspected the closest reports and merged sandbox fixes. I did not find an existing PR implementing this specific removal of redundant generic DENY bits or an earlier report with the same capacity reproduction. This is a search result, not a guarantee that no related work exists.
The draft PR source and manual validation remain at MeroZemory@0144c578d4 . No upstream PR has been created: the authenticated account is currently denied permission to executeCreatePullRequest. No Rust/Codex build or Rust regression-test execution is claimed.
MeroZemory commentedon Oct 3, 2026
Remaining startup path identified and current working session recovered
Removing the saturated .aws directory did not resolve this large-profile workspace's outage. The remaining protected .codex tree contained 132,175 files. There were 529 current workspace/root capability SIDs, 508 of which initially lacked the required write DENY on this protected root. The existing setup path applies each missing SID with a separate SetSecurityInfo call, causing repeated inheritance propagation over the tree.
This was measured directly. A noninvasive debugger snapshot of a stalled helper showed a recursive ntmarta inheritance walk under SetSecurityInfo / CreatePrivateObjectSecurityEx. A WPR CPU profile assigned approximately 81-87% of sampled profile weight for seven stalled setup helpers to ntdll. These are per-process module profile weights, not total-system CPU percentages. One further helper remained alive for more than 8 hours before cleanup and had accumulated 29,829.7 CPU-seconds. Log entries showed individual deny applications about eight minutes apart. Parent processes were recorded; I am not labeling all helpers as orphaned processes.
A setup helper that had already read the old ACL subsequently overwrote a manual bulk-recovery result. The final repair therefore first stopped the verified long-running helper, compacted only equivalent generic/specific DENY pairs, retained all historical SID protections and allow ACEs, and added the missing current protections in one update. That full-tree operation still took 754.2 seconds. The resulting root DACL is 42,172 bytes / 1,172 ACEs with all 1,167 deny principals retained. This is substantial real elapsed work, not an instant workaround.
A second, independent trigger was also confirmed: multiple CODEX_HOME directories shared the same two machine-wide sandbox accounts but kept different encrypted password records. The default home's two LogonUserW checks failed with 1326 while the other active home's two checks succeeded. That is an exact instance of existing #40627; I am adding corroboration there rather than opening a duplicate. One-time reconciliation copied only the proven-valid encrypted sandbox-account record into the stale home, preserving its owner/DACL and leaving Windows passwords unchanged. Both homes then passed both checks.
After both local repairs, the actual existing session, with its original managed elevated full-profile workspace-write policy, completed a real file write/read in 0.362 seconds (exit 0). Follow-up commands also succeeded, and no setup helper remained. Separate small-workspace elevated A -> B -> A checks across the two homes all wrote/read successfully in 2.18 / 1.90 / 2.35 seconds; neither credential file changed. The small-workspace checks do not replace the actual full-profile session check.
The proxy was independently tested: five /healthz requests returned 200, and one supported minimal streaming Responses request completed successfully with OK in 2.84 seconds. This is a single inference probe, not a broad latency benchmark. The observed native ACL startup outage was upstream of any model request; CPU power-state or RAM exhaustion is not established as its cause.
The proposed source mitigation now combines specific-only DENY masks with one batched DACL update per protected path. A small native Windows 100-SID fixture measured 0.6115 seconds serial versus 0.0171 seconds batched, with existing allow ACEs and child inheritance preserved. A mixed/duplicate fixture added only 90 missing entries, made one setter call, and made zero calls on retry. These fixture results do not promise that a 132k-file production tree completes in milliseconds.
No Codex/Rust build, cargo check, or Rust regression execution was performed for this added work. Validation used actual Windows APIs and manual live-session commands; Rust regression source was added for CI. The installed binary is unchanged, so local recovery is verified but permanent prevention is not claimed. Provisioning a new home/protected capability can reproduce the underlying defects. This issue remains open because its ACL capacity/amplification and repeated propagation findings are distinct from the duplicate multi-home account issue.
Reviewable source, rebased on current upstream b65ab46: specific-only masks, batched protected-path updates. The branch is published, but GitHub denied this account's upstream pull-request creation; no upstream PR is claimed. Compare the proposed changes.