Skip to content

Harden launchers/patchers from external audit + add CI#4

Merged
phase3dev merged 2 commits into
mainfrom
codex-audit-fixes
Jun 9, 2026
Merged

Harden launchers/patchers from external audit + add CI#4
phase3dev merged 2 commits into
mainfrom
codex-audit-fixes

Conversation

@phase3dev

Copy link
Copy Markdown
Owner

Addresses an external (Codex) security/robustness audit of the workaround
launchers and patchers.

Fixes

  • Windows wrappers no longer shell out to claude.cmd/.bat. They resolve the
    npm shim to node + cli.js and spawn with shell: false, failing closed if
    unresolved, so prompt/arg metacharacters (& | < > ^ % ") can no longer be
    interpreted locally.
  • Thinking launchers (bash + win.js) handle --flag=value forms and validate
    CC_THINKING_DISPLAY (summarized|omitted).
  • Context-icon patchers skip ambiguous multi-match bundles instead of replacing
    globally, matching fix-context-icon.py.
  • proxy.js strips hop-by-hop headers on both request and response paths and
    validates CC_THINKING_DISPLAY.
  • fix-context-icon.py writes via a same-directory temp + os.replace,
    preserving owner/group/mode, instead of truncate-in-place.
  • patch-extension.sh drops the Bash 4 mapfile for a portable read loop.
  • test-thinking-display.sh uses mktemp + trap and optional timeout/gtimeout.

Tests + CI

  • tests/test_regressions.py (10 tests) covering the above, including the
    context-icon single-match happy path and equals-form flag handling.
  • .github/workflows/ci.yml runs bash -n, ShellCheck (severity=warning),
    node --check, py_compile, and the regression suite on push and PRs.

Known limitation

  • The fix-context-icon.py cross-owner chown path (root patching a user-owned
    bundle) is verified by inspection only; the single-user test cannot exercise it.

phase3dev and others added 2 commits June 8, 2026 22:59
Fixes from an external audit of the workaround launchers and patchers:

- Windows wrappers no longer shell out to claude.cmd/.bat. They resolve
  the npm shim to node + cli.js and spawn with shell:false, failing
  closed if it cannot be resolved, so prompt/arg metacharacters
  (& | < > ^ % ") can no longer be interpreted locally.
- Thinking launchers (bash + win.js) handle --flag=value forms and
  validate CC_THINKING_DISPLAY (summarized|omitted).
- Context-icon patchers skip ambiguous multi-match bundles instead of
  replacing globally, matching fix-context-icon.py.
- proxy.js strips hop-by-hop headers on both request and response paths
  and validates CC_THINKING_DISPLAY.
- fix-context-icon.py writes via a same-directory temp + os.replace,
  preserving owner/group/mode, instead of truncate-in-place.
- patch-extension.sh drops the Bash 4 mapfile for a portable read loop.
- test-thinking-display.sh uses mktemp + trap and optional timeout.
- Add tests/test_regressions.py (10 tests) covering the above, including
  the context-icon single-match happy path; ignore Python bytecode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- .github/workflows/ci.yml runs bash -n, ShellCheck (severity=warning),
  node --check, py_compile, and the regression suite on push and PRs.
  ShellCheck gates at warning severity: the only findings are info-level
  SC2015 (A && B || C) notes where the C branch is the intended
  best-effort behavior.
- Note in the #5 patcher test that the root-patches-user-owned-file
  chown path is not exercised by the single-user test and is verified
  by inspection only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@phase3dev phase3dev merged commit b12baf2 into main Jun 9, 2026
1 check passed
@phase3dev phase3dev deleted the codex-audit-fixes branch June 9, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant