Skip to content

fix(plugin): avoid PATH lookup during MCP launch - #606

Draft
ianw-oai wants to merge 1 commit into
mainfrom
codex/fix-critical-vulnerability-in-mcp-launcher
Draft

fix(plugin): avoid PATH lookup during MCP launch#606
ianw-oai wants to merge 1 commit into
mainfrom
codex/fix-critical-vulnerability-in-mcp-launcher

Conversation

@ianw-oai

Copy link
Copy Markdown
Collaborator

Motivation

  • The Unix MCP launcher used $(dirname "$0"), which performs an external dirname lookup via PATH and can run repository-controlled executables before the launcher selects a managed Node runtime.

Description

  • Replace the external dirname invocation with shell parameter expansion and the shell builtin cd to compute the launcher's directory in sdk/typescript/_bundled_plugin/scripts/launch_codex_security_mcp.
  • Use a small case to preserve both slash-qualified and bare invocation paths and then canonicalize with cd and pwd so no external utilities are invoked.
  • Add a regression test sdk/typescript/tests-ts/mcp-launcher.test.ts that places a synthetic dirname on PATH, starts the launcher, and asserts the synthetic executable is not executed.
  • No functional change to Windows launcher behavior or to the managed Node selection logic beyond eliminating the unsafe lookup.

Testing

  • Ran bun test --timeout 30000 tests-ts/mcp-launcher.test.ts, and the new test passed.
  • Ran the full package test suite with pnpm run test -- --seed 12345, and the tests passed.
  • Ran pnpm run types and pnpm run format, and both checks passed.
  • Ran git diff --check to verify formatting and whitespace, and it passed.

Codex Task

@ianw-oai ianw-oai added the codex label Aug 21, 2026
@github-actions github-actions Bot added the bug Something isn't working label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant