Skip to content

fix(windows): report codex.cmd shims as unsupported instead of failing spawn with EINVAL #57

Closed

Description

@abruption

What happened

Security and stability hardening audit finding TS-09 / Low (2026-09-28). Priority is an audit recommendation, not a claim of a production incident.

On Windows, executable() and the doctor tool() probe <name>.exe, then <name>.cmd. run() always spawns with shell: false. Since the Node.js fix for CVE-2024-27980 (18.20.2 / 20.12.2 and later), spawning a .cmd/.bat file without a shell throws EINVAL synchronously. When codex is installed only through the npm shim (codex.cmd), sends fail as operation_failed while doctor reports the executable as available.

This is from source review and documented Node.js behaviour; it was not reproduced on Windows. VALIDATION.md only records a native codex.exe case.

What you expected

A .cmd/.bat resolution is reported explicitly (for example executable_unsupported with guidance to use the native codex.exe) consistently in doctor and send. Switching to shell: true must not be used, because the message is an argv element.

Environment

  • Baseline: published session-peer 0.2.0 (npm latest), repository commit 38a1300369443e064f58bb18e8bda70f31af0fbb.
  • Audit environment: macOS arm64, Node 22.14.0.
  • No live message tests or production mutation.
  • Windows behaviour inferred from source and Node.js documentation only.

Source evidence

Acceptance criteria

  • Windows CI covers a PATH containing only codex.cmd.
  • doctor and send agree on whether the resolved executable is usable.
  • No shell is introduced for message delivery.

Scope and limitations

Fails safe (submitted: false); reliability and diagnostics accuracy only.

Checked

  • Searched existing issues in this repository and in abruption/session-peer for duplicates.
  • Removed credentials, conversation contents, private paths and real device/session identifiers.
  • Used isolated fixtures without weakening inbound permissions.
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

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions