codex-computer-use-mcp
tmustier/codex-computer-use-mcp
- Type
- MCP server
- Scanned
- Nov 17, 2026
- Version
- 7b6d6af433c8
- Files read
- 61
This MCP server and Pi extension exposes OpenAI's macOS Computer Use runtime from a local ChatGPT installation so an AI coding agent can inspect and operate Mac apps and browser tabs. Its biggest risks are that the main automation tool marks itself as read-only—allowing MCP clients to auto-approve prompt-injected desktop and browser actions without user confirmation—and that Spotlight app discovery combined with flaws in signature checking and version path handling can let an untrusted .app folder on disk execute code.
What it can reach
- System
- Reads window screenshots and accessibility trees and clicks, drags, scrolls, presses keys, and types text in macOS applications through OpenAI's local Computer Use service.
- Browser
- Lists, opens, reads, acts in, and closes browser tabs (such as Chrome via ChatGPT's extension), bypassing ChatGPT's per-turn browser access grant.
- Shell commands
- Spawns macOS utilities (codesign, mdfind, plutil, pgrep, lsof, and open for user-accepted elicitation URLs) and runs ChatGPT's bundled Codex app-server and node_repl binaries.
- Files
- Reads ChatGPT bundles and plugin configs under /Applications, ~/Applications, and ~/.codex, writes private metadata audit logs under ~/.direct-computer-use (or Pi's agent directory), and saves truncated Pi text output to private files in /tmp.
Findings
-
HighComputer Use execution tool falsely advertises readOnlyHint: true to MCP clients
The js (cua_repl) tool lets the agent drive native macOS apps (including Terminal and Finder) and authenticated browser tabs—with ChatGPT's per-turn browser grant stripped—yet src/tools.ts and the fallback in src/direct-service.ts advertise readOnlyHint: true, destructiveHint: false, and openWorldHint: false (and src/legacy/tools.ts marks mutating GUI tools destructiveHint: false and openWorldHint: false). MCP hosts and coding agents commonly auto-approve readOnlyHint: true tools without prompting the user. If the agent reads untrusted text containing a prompt injection, the client can silently run arbitrary desktop and browser actions without asking for confirmation.
Fix: Set readOnlyHint: false, destructiveHint: true, and openWorldHint: true on the js tool in src/tools.ts and src/direct-service.ts, and set destructiveHint: true and openWorldHint: true on the mutating action tools in src/legacy/tools.ts.
-
HighWeak code-signature check and Spotlight search allow untrusted app bundles on disk to run code
When /Applications/ChatGPT.app and ~/Applications/ChatGPT.app do not contain the bundled codex binary (for instance, before ChatGPT is installed or when the classic ChatGPT app occupies ChatGPT.app), src/direct-broker.ts and src/legacy/direct-broker.ts query Spotlight via mdfind across the entire user filesystem, including ~/Downloads and cloned git repositories. verifySignedBinary then runs codesign --verify --strict without a cryptographic requirement (-R), which macOS passes even for ad-hoc signed binaries with no Apple certificate, and checks codesign -dv text output with a regex for TeamIdentifier=2DC432GLL2. Because an ad-hoc signature can inject a TeamIdentifier=2DC432GLL2 line via an unescaped signing identifier or ad-hoc CodeDirectory team field, a crafted .app folder in a cloned repository passes verification and is immediately executed with the user's full environment during status checks or tool calls.
Fix: Pass an explicit Apple cryptographic requirement to codesign --verify (such as -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.OU] = "2DC432GLL2"') in both src/direct-broker.ts and src/legacy/direct-broker.ts, and restrict mdfind to /Applications and ~/Applications with -onlyin.
-
HighPath traversal via unverified app Info.plist version loads untrusted MCP configuration
At server startup (selectComputerUseRoute) and session creation, readCuaReplServer reads CFBundleShortVersionString from Contents/Info.plist of the discovered .app bundle without verifying the outer .app bundle's signature and joins that version string directly into the plugin cache path without checking for '..' or path separators. If Spotlight discovers an untrusted .app directory in ~/Downloads or a cloned repository—even one holding a copy of a genuinely OpenAI-signed codex binary—a version value such as ../../../../../Downloads/... traverses out of ~/.codex/plugins/cache/openai-bundled/unified-computer-use to an attacker-controlled .mcp.json. This injects attacker-controlled server instructions and tool descriptions into the MCP server on startup and forwards arbitrary env entries (such as NODE_OPTIONS) from that file into the spawned node_repl process.
Fix: Verify the outer ChatGPT.app bundle signature before reading Info.plist, reject version values containing '/' or '..' so the resolved path stays inside the expected cache directory, and allowlist safe environment variables from .mcp.json rather than forwarding arbitrary env keys like NODE_OPTIONS.
