Repository navigation
Description
Found in the #594 security audit. Severity: medium. Status: confirmed (failing test).
Affected code
crates/tole-core/src/plugin_lock.rs:421admit(lock, server, version, tools): compares the manifest hash and the server-reported version. The entry'ssource(stdio:<command line>or URL) andintegrity(sha256 of the stdio binary) are recorded at approval (plugin_gate.rsapprove) and never compared.LockEntry.secrets(and a project lock narrowing it ineffective) is not used by any launcher: the stdio env comes from the release consumermcp(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
- Pass the configured source to
admit/Gate::checkand returnChangedwhen it differs fromentry.source(normalized: same argv, same URL origin+path). - Enforce
integrityfor stdio servers whose program resolves to a file (refuse on mismatch; re-approval shows the new hash); for launcher sources (npx,uvx,docker) require a pinned package version in the source and document that integrity covers the launcher only (feat(plugins): tole plugin add/list/diff/revoke, description scanner, grants and trust tiers #600 should resolve and pin the package). - Either enforce
LockEntry.secrets(intersect themcprelease with it per server) or remove the field and the project narrowing until feat(plugins): sandbox wrapper for third-party stdio servers, lazy start, tool retrieval by meaning #601.
Activity
fix(plugins): make the ledger authoritative for the bundle record and…