Back to skill

Security audit

mcp-server-discovery-p

Security checks for vulnerabilities and agentic risk

Overview

The skill is not deceptive, but it needs review because it generates MCP configs that can later auto-run unpinned third-party server packages with broad access.

Review before installing. Treat generated configs as executable third-party software, pin package versions, remove automatic `-y` installs where possible, and grant MCP servers only the directories, tokens, databases, and memory retention they truly need.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
scripts/mcp_discover.py:121
Finding
Generated MCP configurations execute unpinned npm packages with automatic confirmation## Vulnerability Details **File Location**: `scripts/mcp_discover.py:121-131` **Additional Locations**: `scripts/mcp_discover.py:25-80`, `SKILL.md:44-49`, `references/registry.md:9-54`, `README.md:51-61` **Vulnerability Type**: Unpinned third-party dependencies and unattended package installation **Risk Level**: Medium ### Vulnerable Code ```python def generate_config(selected_servers: List[str]) -> Dict: """生成 MCP 客户端配置""" config = {"mcpServers": {}} for server_name in selected_servers: server = KNOWN_SERVERS.get(server_name) if server: config["mcpServers"][server_name] = { "command": "npx", "args": ["-y", f"@modelcontextprotocol/server-{server_name}"] } return config ``` The package registry also contains installation commands following the same pattern: ```python "filesystem": { "name": "filesystem", "description": "Secure file system access with configurable permissions", "url": "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem", "install": "npx -y @modelcontextprotocol/server-filesystem", "category": "filesystem" }, ``` ### Technical Analysis The generated MCP client configuration invokes npm packages through `npx` without specifying exact package versions or integrity information. Consequently, package resolution occurs when the downstream MCP client executes the generated configuration, rather than being restricted to a version reviewed with this Skill. The `-y` argument automatically accepts installation prompts. This reduces the opportunity for users to inspect the package name, resolved version, and installation source before package-controlled code runs. The Skill itself does not immediately execute these commands, and no evidence shows that the referenced packages are currently malicious. The vulnerability is a supply-chain exposure: if a package ...[truncated 1809 chars]
Remediation
## Remediation Suggestions 1. Pin every recommended npm package to a reviewed exact version, for example: ```python VERIFIED_PACKAGES = { "filesystem": { "package": "@modelcontextprotocol/server-filesystem", "version": "REVIEWED_EXACT_VERSION" } } ``` Generate arguments using the exact package specifier: ```python package = server["package"] version = server["version"] config["mcpServers"][server_name] = { "command": "npx", "args": [f"{package}@{version}"] } ``` 2. Remove `-y` so package installation requires explicit user approval. Clearly warn users that accepting the installation executes third-party code. 3. Prefer a separate, explicit installation workflow using a local project, a lockfile, and npm's integrity verification. Generated MCP configurations should then invoke an already installed, reviewed executable rather than dynamically downloading packages at client startup. 4. Maintain an allowlist that maps each server name to a fixed package name and version. Do not construct package identifiers from user input, even though the current `KNOWN_SERVERS` lookup limits accepted names. 5. Record package provenance, reviewed version, release date, and upstream repository for each entry. Re-review packages before updating pinned versions. 6. Document the permissions required by each MCP server and advise users to expose only the minimum necessary directories, credentials, databases, and network destinations. 7. Consider running third-party MCP servers in a restricted container or sandbox with a dedicated low-privilege account, minimal environment variables, read-only filesystems where practical, and outbound network controls.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill advertises comprehensive, reliable, up-to-date MCP server discovery and management, but the described behavior appears limited to operations over a static predefined list. This mismatch can mislead users and downstream agents into trusting stale or incomplete results, which is a security concern when configuration generation or server selection decisions depend on current authoritative data.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The primary skill description is written in Chinese and the document does not indicate any language choice, fallback, or opt-in for users who may expect another language. This is a natural-language locale policy concern because the skill implicitly constrains interaction/documentation language without documenting that limitation or giving alternatives.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill invokes a Python script to perform MCP discovery operations and the metadata declares no explicit tool scope or permissions. In a skill that may interact with remote registries or MCP-related network resources, missing scope boundaries can cause the agent to over-assume allowed capabilities and makes review and enforcement of network use harder.

Vague Triggers

Medium
Confidence
87% confidence
Finding
The description is broad enough to match generic discovery, configuration, or server-management requests beyond MCP-specific tasks. Over-broad routing increases the chance this skill is invoked in contexts where it is not appropriate, potentially exposing users to misleading outputs, unnecessary code execution, or handling of unrelated configuration tasks.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The documentation promotes filesystem, web, database, and memory-related MCP server categories without any warning about data access, privacy exposure, credential handling, or system impact. In this context, those server types can grant access to sensitive local files, remote content, databases, or persistent memory stores, so omission of safety guidance meaningfully increases the risk of unsafe use.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The documentation instructs users to run an unpinned package via `npx`, which fetches the latest published version at execution time. If the upstream package is compromised, replaced, or ships a breaking/security-relevant update, users may execute unexpected code with local file access under the trust implied by this registry reference.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
This reference recommends executing an unpinned GitHub integration package through `npx`, causing resolution to whatever version is current at runtime. A compromised or malicious release could gain access to repository operations and any provided `GITHUB_TOKEN`, increasing the risk beyond a generic package fetch.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
Using `npx` with an unversioned PostgreSQL server package means the command will install and run whichever release is latest. If that package is tampered with or introduces unsafe behavior, it could access database connection material and interact with production data unexpectedly.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The SQLite install example is unpinned, so users are directed to execute code that may change over time without notice. In a skill focused on server discovery and configuration, such copy-paste-ready commands are likely to be used directly, making supply-chain risk more practical.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The Puppeteer server example invokes an unpinned package through `npx`, allowing silent drift to arbitrary future code. Because browser automation often processes untrusted web content and may access local browser/session context, executing a compromised release could materially expand attack surface.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
This Brave Search package is referenced without a version pin, so users may unknowingly execute newly published code. Even where the functionality seems lower risk, the skill serves as a trusted registry and therefore amplifies the chance that users will run the command verbatim.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The fetch server is installed via an unpinned `npx` command, exposing users to package substitution or malicious updates at runtime. Since fetch-style servers commonly retrieve remote content and may be granted network access in agent workflows, a compromised package could abuse that trust boundary.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The memory server example is unpinned, so users may execute whatever version is current when they copy the command. Because this server is intended to persist information across sessions, a compromised update could exfiltrate or improperly retain sensitive data over time.

External Transmission

Medium
Category
Data Exfiltration
Content
MCP_REGISTRIES = {
    "official": "https://raw.githubusercontent.com/modelcontextprotocol/servers/main/README.md",
    "awesome": "https://raw.githubusercontent.com/appcypher/awesome-mcp-servers/main/README.md",
    "community": "https://api.github.com/search/repositories?q=topic:mcp-server+sort:updated"
}

# 已知的高质量 MCP 服务器列表
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The script embeds `npx -y @modelcontextprotocol/server-filesystem` without a pinned version, which causes installs to resolve to the latest published package at execution time. In a discovery/configuration skill, this creates a supply-chain risk: a compromised upstream package, malicious republish, or breaking update could be pulled automatically into generated configs or copied commands.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The unpinned `npx -y @modelcontextprotocol/server-github` reference allows execution of whatever package version is current when the command is run. Because this tool is meant to help users discover and configure MCP servers, it can normalize copy-pasting or auto-generating commands that fetch unreviewed code from the registry, increasing supply-chain exposure.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Using `npx -y @modelcontextprotocol/server-postgres` without version pinning means the resolved package can change over time, including to a malicious or incompatible release. In a tool that emits configuration for database-capable servers, silently pulling the newest package heightens risk because the resulting server may gain unsafe behavior or unexpected permissions.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The `npx -y @modelcontextprotocol/server-sqlite` command is unpinned, so clients may install and execute a different package version than intended. That is a real supply-chain weakness because MCP servers are executable components, and this discovery tool directly encourages their installation and use.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The unversioned `npx -y @modelcontextprotocol/server-puppeteer` reference can pull arbitrary future releases at runtime. Since browser automation servers often have broad network and content-access capability, the skill context makes this somewhat more dangerous than a purely informational dependency because users may execute powerful code obtained on demand.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The `npx -y @modelcontextprotocol/server-brave-search` install string lacks version pinning, allowing the fetched code to vary over time. This is a true vulnerability because the tool presents these commands as trusted installation paths, which could result in execution of compromised upstream code if the package supply chain is attacked.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The script recommends `npx -y @modelcontextprotocol/server-fetch` without pinning a specific version, so each invocation may retrieve different code. In a utility centered on server discovery and configuration, this directly amplifies supply-chain risk because users are likely to trust and reuse the provided command verbatim.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The `npx -y @modelcontextprotocol/server-memory` command is unpinned and therefore subject to upstream changes at runtime. This is dangerous because it encourages dynamic execution of external code in an MCP environment, where a malicious update could access prompts, context, or local resources depending on server capabilities.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The registry describes persistent memory as a feature but does not warn that data may be retained across sessions, potentially including sensitive prompts, user data, or secrets. In a discovery/configuration reference, omission of that privacy context can cause operators to enable the service without informed consent or appropriate safeguards.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The module docstring includes a Chinese-only description line, which imposes a specific language in user-facing natural language without any opt-in or alternative. The policy requires either offering language choice or clearly justifying the locale constraint, neither of which is present here.

Static analysis

No suspicious patterns detected.