openai / openai/codex-security

Windows scan output directories are not ACL-hardened like credential homes

Open
#201 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:bulk-scan area:reports area:sandbox bug platform:windows priority:p1
Dominant language
TypeScript
Stars
10.8k
Forks
801
Avg merge
1d 8h
Merged PRs (30d)
257

Description

Summary

On POSIX, scan output directories are required to be mode 0700 and owned by the current user, and shared parents are checked for sticky/trusted ancestry (#118). Credential homes on Windows get an equivalent current-user-only ACL via secureWindowsCredentialHome.

Scan output on Windows has no equivalent. requirePrivateOutputDirectory and requireSecureOutputAncestry both early-return on win32, so prepared scan trees keep inherited ACLs. On a shared Windows directory (e.g. C:\Users\Public\... or a folder with inherited Allow rules for other users), another local principal can read or replace scan artifacts between prepare and complete-scan / contract load.

Evidence (current main @ 3bf2621, @openai/codex-security@0.1.5)

sdk/typescript/src/runtime.ts:

  • requirePrivateOutputDirectoryif (process.platform === "win32") return;
  • requireSecureOutputAncestry — same early return
  • secureWindowsCredentialHome / private ACL apply+verify exists for credential homes only
  • validatePreparedOutputDir / validateOutputDir / contract requireScanRoot call the no-op Windows helpers
  • Multiscan ensureOutputDirectory previously only mkdir'd without any private check

Workbench Python require_canonical_scan_directory also skips privacy on nt.

Steps to reproduce (Windows)

  1. Create a scan output path under a directory that inherits Allow ACEs for other local users (e.g. a Public or shared folder).
  2. Run codex-security scan (or bulk-scan) with that --output-dir.
  3. Observe the created scan directory does not have access-rule protection restricted to the current user (contrast with …/codex-home after login, which does).
  4. Another local user who inherits Allow on the parent can read findings/reports or replace sealed artifacts before completion.

Why in scope (SECURITY.md)

  • Credentials, private source, and scan results must stay out of other security principals
  • File-replacement races that forge completed scans or leak results
  • Same boundary already enforced for Windows credential homes and POSIX scan output

Suggested fix

Reuse the credential-home Windows ACL helper for scan output:

  1. Apply + verify a current-user-only ACL when preparing scan output
  2. Re-verify on contract load / scan-root checks
  3. Apply the same private-output gate to multiscan / bulk-scan campaign roots

Affected version

  • @openai/codex-security@0.1.5
  • Confirmed on main at 3bf2621

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sdk/typescript/src/runtime.ts with requirePrivateOutputDirectory, requireSecureOutputAncestry, secureWindowsCredentialHome, and the validation paths that call them. Then inspect Workbench Python's require_canonical_scan_directory and multiscan ensureOutputDirectory. Done means Windows scan output and campaign roots apply and verify current-user-only ACLs during preparation and contract or scan-root checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.