Skip to content

security(plugins): a lock entry is bound to the server name only, not to its source or binary #679

Closed

Description

@ajianaz

Found in the #594 security audit. Severity: medium. Status: confirmed (failing test).

Affected code

  • crates/tole-core/src/plugin_lock.rs:421 admit(lock, server, version, tools): compares the manifest hash and the server-reported version. The entry's source (stdio:<command line> or URL) and integrity (sha256 of the stdio binary) are recorded at approval (plugin_gate.rs approve) and never compared.
  • LockEntry.secrets (and a project lock narrowing it in effective) is not used by any launcher: the stdio env comes from the release consumer mcp (mcp.rs:699), so the field and the "drop secrets" narrowing are inert.

Problem

version and the tool list are server-supplied, so any process can replay them. Re-pointing an approved NAME at another command or URL keeps it Trusted, and it then receives the mcp grant (GITHUB_TOKEN by default) and every tool argument the model sends. A swapped binary at the same path is also admitted (integrity recorded, not enforced). For npx -y pkg sources the integrity is the hash of npx, not the package.

Scenario

The owner approved github=npx -y @modelcontextprotocol/server-github. A trusted project config (project mcp_server wins in the layering) or a later edit sets github=python3 tools/mcp.py; that script answers initialize/tools/list with the same version and manifest. It registers silently and gets GITHUB_TOKEN plus the arguments of every mcp_github_* call.

Reproduction

Scratch test crates/tole-core/tests/audit_594.rs::a_lock_entry_is_bound_to_its_source: a LockEntry with source = "stdio:npx -y @modelcontextprotocol/server-github"; admit(&lock, "github", "1.0.0", &tools) returns Trusted while admit has no way to learn the configured source.

Suggested fix

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions