Skip to content

fix: avoid codex apps probing during server listing#11

Open
lydakis wants to merge 1 commit intomainfrom
codex/fix-codex_apps-stdio-execution-vulnerability
Open

fix: avoid codex apps probing during server listing#11
lydakis wants to merge 1 commit intomainfrom
codex/fix-codex_apps-stdio-execution-vulnerability

Conversation

@lydakis
Copy link
Owner

@lydakis lydakis commented Mar 23, 2026

Motivation

  • Server listing previously performed Codex apps discovery which invoked listTools for codex_apps, allowing stdio transports to be spawned during mere list_servers/CLI completion and creating an execution-on-list regression.
  • The intent is to restore the prior contract that listing servers is a config-only operation and must not connect to or launch tools.

Description

  • Remove Codex apps tool enumeration from Catalog.ServerNames so ServerNames no longer calls the listTools callback and therefore will not trigger MCP connections for codex_apps (internal/servercatalog/catalog.go).
  • Preserve Codex discovery for resolution and tool lookup paths so virtual server resolution still works when explicitly requested (Catalog.Resolve remains unchanged).
  • Update tests to assert server listing does not invoke codex discovery and emits no warning: adjust internal/servercatalog/catalog_test.go and internal/daemon/daemon_tools_test.go to expect only configured servers and zero list-tools calls during listing, and remove an unused import in the daemon test.

Testing

  • Ran the full test suite with the Codex runtime env disabled using env -u CODEX_HOME go test ./..., and all packages passed after the changes (tests previously failed before fixes).
  • Ran env -u CODEX_HOME go vet ./... with no issues reported.
  • Ran env -u CODEX_HOME go build ./... which completed successfully.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c616de5d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -50,25 +51,6 @@ func (c *Catalog) ServerNames(ctx context.Context) ([]string, error) {
names[name] = struct{}{}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include discovered Codex app aliases in server listing

For users relying on Codex app fallback/discovery, aliases such as linear and zillow only exist after listTools feeds codexVirtualServerMap; this implementation now returns only the literal cfg.Servers keys (minus codex_apps), so list_servers becomes empty or incomplete. That regresses multiple CLI paths that consume list_servers: the root mcpx listing can incorrectly print “No MCP servers configured” (internal/cli/root.go), mcpx <alias> --help rejects valid virtual servers because it preflights against that list, and completion / mcpx shim install <alias> no longer discover those servers (internal/cli/completion_runtime.go, internal/cli/shim.go). The docs still advertise these virtual per-app servers in docs/usage.md.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant