Repository navigation
fix: bind macOS node allowlist commands safely - #104337
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 5:23 AM ET / 09:23 UTC. Summary PR surface: Source +5, Tests +5. Total +10 across 2 files. Reproducibility: yes. Current source constructs the rejected Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the platform-specific non-login transport while preserving the Mac host’s strict static-command binding checks and treating profile-dependent node commands as unsupported rather than weakening authorization. Do we have a high-confidence way to reproduce the issue? Yes. Current source constructs the rejected Is this the best way to solve the issue? Yes, subject to explicit acceptance of the compatibility effect. Selecting the Mac host’s already-supported transport at the existing platform-aware constructor is narrower and safer than weakening reusable-authorization checks or adding a second execution path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against adb05e72dc0f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +5, Tests +5. Total +10 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
* fix: bind macOS node allowlist commands safely * chore: leave node fix notes in PR
* fix: bind macOS node allowlist commands safely * chore: leave node fix notes in PR (cherry picked from commit 6e81c54)
What Problem This Solves
Mac App nodes using
security=allowlistreject exact executable approvals from the agent's standardnode_execpath. The caller wraps macOS commands in a login shell, while the Mac host correctly refuses to reuse approval through login startup files.Fixes #104330.
Why This Change Was Made
Use the Mac host's existing safe binding contract:
/bin/sh -cfor a static macOS payload. The Mac App can then resolve and bind the exact approved executable before execution. Windows remains oncmd.exe; Linux and unknown POSIX nodes retain/bin/sh -lcto avoid expanding this compatibility change beyond the proven regression.The platform match covers both Node's
darwinidentifier and the Mac App's versionedmacOS 26.5.2-style metadata.User Impact
/bin/hostnameMac-node approval still returnedSYSTEM_RUN_DENIED: allowlist miss.Evidence
tbx_01kx86ejmwtkvgcj5b3zf4qp0a:corepack pnpm test src/infra/node-shell.test.ts— 3 passed.tbx_01kx86hredg07pjg317k793t2n: touched-filecheck:changed— passed.megaclawallowlist policy:/bin/sh -lc /bin/hostnamewith raw command/bin/hostname— denied as allowlist miss./bin/sh -c /bin/hostnamewith the same raw command — exit 0, stdoutmegaclaw.Changes
src/infra/node-shell.ts: select non-login shell transport fordarwinand versionedmacOSnode metadata.src/infra/node-shell.test.ts: cover real Mac App metadata and preserve other-platform behavior.