Skip to content

Apply macOS app-bundle execution validation to ocx codex and the app-server launcher #7860

Closed

Description

@lidge-jun

Area

Platform (Windows / macOS / Linux)

What are you trying to accomplish?

#7758 validates a selected macOS ChatGPT app executable at each execution boundary that runs it: explicit paths, discovered candidates, memoized selections, login, catalog, prompt probing, remote workspace and app-server startup. I would like the two remaining launch paths to apply the same check at the moment they start the executable.

What prevents this today?

Two paths start a Codex executable without the shared execution-boundary check:

  • ocx codex (src/cli/codex-launcher.ts) resolves codex from PATH or a recorded shim backing path and spawns it directly.
  • The generated ChatGPT app-server launcher script (src/chatgpt/app-server-shim/launcher.ts) checks the target when it is written, and later invocations or respawns execute the recorded target without checking it again.

Both paths predate #7758 and were left outside its diff.

What should OpenCodex do?

When either path selects an executable inside a macOS app bundle, OpenCodex should run the shared execution-boundary validation (ownership, permissions, link handling, signature and Team ID) on the final command right before each launch, and refuse to launch if validation fails. Non-bundle executables keep their current behavior.

Example usage or interface

# codex on PATH points into /Applications/ChatGPT.app
ocx codex --version
# expected: the bundle executable is validated before this launch, as for every other execution boundary

Alternatives or workarounds

Launching Codex through the other OpenCodex entry points, which already validate the selected executable.

Additional context

Follow-up to #7758 and #7346.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

  1. added
    enhancement
    on Oct 28, 2026
  2. added
    cli
    platform
    on Oct 28, 2026
  3. luvs01 commented on Oct 28, 2026

    @luvs01
    Collaborator

    Verified candidate published as Draft PR #7876: #7876

    Current head 1e496e07338307c426321ac0859f0611571b380a, verified base f9e7d939, remote tree f5dceb6a6e2209a37d4613cb669ffdb323a1a7b1 exactly matches the locally validated index. Both remaining boundaries now use the existing shared validator immediately before launch: the CLI's final resolved backing and every generated app-server invocation/respawn. The hidden helper skips automatic shim repair and emits only one validated path. Validator failure, absence or empty output refuses startup; uname cannot authorize a bypass.

    The new portable/real-shell regression cases passed. Initial focused execution had 337 passes and four sandbox-related failures in existing tests; only those two files were rerun with normal local execution permission, yielding 34 passes and no failures. Final changed-impact validation: 858 passed / 21 skipped / 21 failed. The 21 failing credential fixture names exactly match an untouched-base comparison (108 passed / 20 skipped / 21 failed); they arise from this host's existing machine-wide additional configuration layers, which were neither read nor changed. Candidate-only failures: zero. This is not an all-green changed-impact run.

    Typecheck, structure, privacy, layout/size checks and docs build passed (593 pages / 85,232 internal links). Independent source review found no new blocker. A read-only merge-tree check with newer dev@492c1a15 is clean.

    Preceding behavioral head 93eb841 CI 40637879759 completed successfully, including all four Ubuntu shards. The same-head CodeRabbit review reported no actionable code findings and one docstring warning. Follow-up 1e496e0 adds only the missing dispatcher contract comment; emitted JavaScript is byte-identical. Its new hosted checks and documentation re-review are pending. Explicit maintainer/security acceptance, native macOS signature/ownership acceptance and a real ChatGPT Desktop restart remain separate conditions. Portable injected-verifier/Linux shell tests do not replace those checks, and no new process-level cancellation acceptance is claimed. The issue remains open pending integration and acceptance.

  4. lidge-jun commented on Oct 30, 2026

    @lidge-jun
    OwnerAuthor

    Fixed by #7876, merged into dev as a2ae4825350813b41d92abf2231924ed8950ef63. ocx codex now runs the shared execution-boundary validation on the final backing command right before each launch. The generated ChatGPT app-server launcher re-validates its recorded target on every invocation and respawn, through the hidden ocx internal codex-exec-target helper, and refuses to launch on failure. Non-bundle executables keep their behavior. Native macOS codesign and extended-ACL behavior were not exercised. Extended ACLs are a documented limitation of the shared bundle-trust policy and are not covered by this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementplatform

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions