codex-security icon indicating copy to clipboard operation
codex-security copied to clipboard

Windows credential-home provisioning rejects volume root owned by Everyone (S-1-1-0)

Open usernamiEnter opened this issue 1 month ago • 3 comments

Summary

On Windows 11 x64, @openai/[email protected] rejects credential-home preparation because ancestor validation traverses to the system volume root C:\\, which is reported as owned by Everyone (S-1-1-0). The error occurs before the package can repair the target credential-home DACL, so a ChatGPT-authenticated local security diff scan cannot start.

This is a request for a supported remediation that does not change the owner or ACL of the system volume root, not a request to disable credential privacy checks.

Reproduction / observations

  • Windows 11 x64; npm CLI @openai/[email protected]; Codex runtime 0.163.0; bundled plugin 0.1.95.
  • The current user owns <STATE_DIR>\\codex-home, and has full access.
  • Get-Acl on the ancestor chain reports C:\\ as Owner SID=S-1-1-0; C:\\Users and the user profile are owned by SYSTEM; intermediate Codex state directories are owned by the current user.
  • No reparse points or junctions were observed on the checked path.
  • The target credential-home DACL separately has protected=false and an inherited read-and-execute ACE for CodexSandboxUsers; inspectWindowsCredentialAcl reports this principal in untrustedPrincipals. A target-only DACL repair is therefore needed, but the ancestor check fails first.
  • prepareCodexSecurityCredentialHome({ ...process.env, CODEX_SECURITY_STATE_DIR: "<STATE_DIR>" }) exits before the icacls repair phase.

Observed error:

OutputDirectoryError:
Unable to create a private Windows credential home:
<STATE_DIR>\\codex-home.
Windows credential ACL owner is not a trusted principal: S-1-1-0

Security / mutation boundary

Only a scoped repair of the existing codex-home had been authorized. The package rejected the ancestor check before changing the target. A bounded descriptor rollback restored/verified the original target SDDL. Pre/post checks found unchanged owner, File ID, volume identity and SDDL on the target, and unchanged ancestor descriptors. No system-root ACL/owner change, alternate credential path, elevation, authentication, or scan was performed.

This is a local observation, not a claim that Everyone ownership of a Windows volume root is generically secure.

Questions for maintainers

  1. Is rejecting a Windows volume root owned by Everyone intentional for the credential-home ancestor trust model, or could the root require distinct OS-level security assessment?
  2. Is there a supported state-root layout or provisioning workflow that passes validation without modifying C:\\ or bypassing ancestor checks?
  3. If this Windows layout is unsupported, could the CLI return a specific actionable diagnosis rather than treating the root as a repairable credential-home parent?
  4. Is an upstream fix or supported workaround available for v0.4.0?

Related but different: #421 (temporary sandbox ACL entries after scans). That issue does not establish the same root cause here.

No personal SID, username, local home directory or credential contents are included in this report.

usernamiEnter avatar Oct 18 '26 19:10 usernamiEnter

Moving this to P2 and leaving it open. The ancestor-validation check reproduces with a synthetic ACL owned by Everyone, but that rejection is intentional in the current credential trust model. The audit didn't establish a regression in a supported layout.

The next step is to clarify whether this layout is supported and provide a safe provisioning path or a more actionable diagnosis, without requiring changes to the system volume's owner or ACL.

mldangelo-oai avatar Oct 19 '26 03:10 mldangelo-oai

Thanks for the clarification. I checked the current implementation and documentation. The Windows credential-home inspector walks the configured path's ancestors through the volume root and validates each ancestor's owner in inspectWindowsCredentialAclSnapshot (sdk/typescript/src/runtime.ts). The CLI troubleshooting guidance to choose a fresh CODEX_SECURITY_STATE_DIR addresses stale ACLs; if the volume root itself has an owner rejected by the trust model, another directory on that same volume still appears to fail before the target repair.

I can't confirm a supported alternative volume or ownership configuration from the documentation, and I would not change the system volume's owner/DACL or bypass validation. Could maintainers confirm whether using a different volume whose full ancestor chain passes the existing trust checks is supported? If not, would a more actionable error identify the rejected ancestor, rather than only its SID, and state that the layout is unsupported?

Hughhhhcoder avatar Oct 19 '26 06:10 Hughhhhcoder

#1745 shipped in 0.5.0. The error now names the rejected ancestor. If that ancestor is the volume root, moving the state directory to another folder on the same drive won’t help. The supported setup is a private CODEX_SECURITY_STATE_DIR on a separately provisioned volume with trusted ancestry. The Windows troubleshooting notes cover that setup; you can leave the system drive’s owner and ACL alone. Closing this as addressed.

mldangelo-oai avatar Oct 25 '26 05:10 mldangelo-oai