Skip to content

Align Windows sandbox temp permissions with the child environment - #51512

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/16b8bd4702cc434fd743a08c75a3e4515780bff3
Oct 6, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/16b8bd4702cc434fd743a08c75a3e4515780bff3

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Align Windows sandbox temp permissions with the child environment

Why

Windows temp grants could fall back to host TEMP/TMP values and bypass read-only or denied subpaths. Sandbox permissions must match the environment passed to the child process.

What changed

  • Resolve :tmpdir from absolute TEMP/TMP paths in the completed workload environment, preserving access modes and missing-path rules without falling back to host values.
  • Deduplicate Windows environment keys case-insensitively in a deterministic order so permission resolution and the child environment select the same value.
  • Use the resolved temp policy for elevated sandbox overrides across core execution, exec-server, and direct spawning.
  • Launch direct-spawn sandbox wrappers with the supplied Codex executable, materializing an inner helper only when it is that executable.

Testing

Add Windows regression coverage for temp-only writes, read-only and denied carveouts, mixed-case and duplicate environment keys, unavailable temp paths, and empty or missing write-root overrides. Exercise core execution and direct spawning, and extend exec-server RPC coverage to the elevated backend with temp values set through the environment policy.

…1512)

## Why

Windows temp grants could fall back to host `TEMP`/`TMP` values and bypass read-only or denied subpaths. Sandbox permissions must match the environment passed to the child process.

## What changed

- Resolve `:tmpdir` from absolute `TEMP`/`TMP` paths in the completed workload environment, preserving access modes and missing-path rules without falling back to host values.
- Deduplicate Windows environment keys case-insensitively in a deterministic order so permission resolution and the child environment select the same value.
- Use the resolved temp policy for elevated sandbox overrides across core execution, exec-server, and direct spawning.
- Launch direct-spawn sandbox wrappers with the supplied Codex executable, materializing an inner helper only when it is that executable.

## Testing

Add Windows regression coverage for temp-only writes, read-only and denied carveouts, mixed-case and duplicate environment keys, unavailable temp paths, and empty or missing write-root overrides. Exercise core execution and direct spawning, and extend exec-server RPC coverage to the elevated backend with temp values set through the environment policy.

GitOrigin-RevId: 16b8bd4702cc434fd743a08c75a3e4515780bff3
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/16b8bd4702cc434fd743a08c75a3e4515780bff3 branch from 6763eda to 7efc49b Compare October 6, 2026 23:21
@copyberry
copyberry Bot merged commit 7efc49b into main Oct 6, 2026
1 check failed
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-06T23:21:19.266298Z 6763eda PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/16b8bd4702cc434fd743a08c75a3e4515780bff3 branch October 6, 2026 23:21
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
@ichiyaman
ichiyaman deployed to issue-triage October 6, 2026 23:25 — with GitHub Actions Active
@ichiyaman
ichiyaman deployed to issue-triage October 6, 2026 23:25 — with GitHub Actions Active
@ichiyaman
ichiyaman deployed to issue-triage October 6, 2026 23:25 — with GitHub Actions Active
@joconnell117
joconnell117 deployed to issue-triage October 6, 2026 23:26 — with GitHub Actions Active
@joconnell117
joconnell117 deployed to issue-triage October 6, 2026 23:26 — with GitHub Actions Active
@joconnell117
joconnell117 deployed to issue-triage October 6, 2026 23:26 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 7efc49b2 Deployed Oct 6, 2026 by joconnell117 via Translate non-English issue #17911
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants