Back to skill

Security audit

工具移植工具

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to move MCP tool configurations, but it can modify agent tool setups and read local .env secrets without tight scoping or consent safeguards.

Review this before installing. Use it only with a dedicated minimal .env file containing the exact keys needed, inspect any bundle before import, avoid unpinned npx commands in imported MCP configs, and make backups of existing agent configuration so changes can be reversed.

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
SKILL.md:95
Finding

Unpinned Third-Party Package Execution Through npx

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:95
Vulnerability Type: Supply-chain risk caused by unpinned executable dependencies
Risk Level: Medium

Complete Code Snippet:

json
{
  "format": "port-bundle-v1",
  "agents": [{"name": "search", "command": "npx", "args": ["-y", "search-server"]}],
  "secrets": {"API_KEY": "{{PLACEHOLDER:API_KEY}}"}
}

Technical Analysis

The example MCP configuration invokes npx with the -y option and an unversioned package name. If the package is unavailable locally, npx may retrieve the current package release from the configured registry and execute its installation or runtime code without an interactive confirmation prompt.

The configuration does not pin an exact version, verify a package integrity hash, identify a trusted registry, or require approval before execution. As a result, the code ultimately executed can change after the Skill has been reviewed. A compromised package, malicious future release, dependency-confusion package, or registry configuration controlled by an attacker could introduce arbitrary executable code.

Attack Path

  1. An attacker publishes, takes control of, or compromises the package referenced as search-server, or influences the package registry used by the victim.
  2. The victim follows the documented migration example and imports the MCP bundle.
  3. The target Agent or MCP launcher processes the imported command.
  4. It runs npx -y search-server.
  5. npx retrieves the currently resolved package without interactive confirmation.
  6. Package installation hooks or runtime code execute with the permissions of the user running the Agent.

Impact Assessment

Successful exploitation can provide arbitrary code execution under the Agent user's account. The malicious package could access files and environment variables available to that account, including local MCP credentials, modify user-level configuration, invoke ...[truncated 178 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the package to an exact, reviewed version rather than using an unversioned package name.
  2. Use a lockfile and registry integrity metadata to verify the resolved package contents.
  3. Document and enforce the expected package registry and package publisher.
  4. Require explicit user confirmation before installing or executing packages that are not already present locally.
  5. Validate imported MCP commands against an allowlist of approved executables, packages, versions, and arguments.
  6. Prefer installing reviewed dependencies in a controlled build step rather than dynamically retrieving them when an imported configuration runs.
  7. Execute MCP servers with least privilege and restrict their filesystem, environment-variable, and network access.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly instructs the agent to fill placeholders by reading a local .env file containing real credentials. Even if intended for legitimate migration, this is credential access behavior and becomes dangerous when combined with broad execution capability because secrets may be unnecessarily exposed to the agent or mishandled during processing.

Content

Scanner excerpt · SKILL.md (reported line 107)May include surrounding context.

{baseDir}/(请参考skill目录中的脚本文件) import --to cursor --bundle bundle.json

...

替换占位符(导入后填真实凭证)

{baseDir}/(请参考skill目录中的脚本文件) fill --bundle bundle.json --env .env

text

### 场景三:配置校验

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

This example places real credentials into a .env file and implies automated replacement during import, which normalizes agent access to sensitive material. In the context of an MD+EXEC skill with import/export workflows, that increases the chance of credential leakage through command history, logs, model context, or misconfigured file handling.

Content

Scanner excerpt · SKILL.md (reported line 183)May include surrounding context.

凭证占位符替换

bash
# .env 文件填真实凭证
SEARCH_API_KEY=sk-real-key-xxx
# ...
# 导入时自动替换占位符

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The documented workflow states that import reads .env to replace placeholders, confirming secret ingestion as part of routine operation. That behavior is risky because the agent does not need full visibility into local credential stores to perform most migration tasks, and broad secret reads can expose unrelated secrets present in the file.

Content

Scanner excerpt · SKILL.md (reported line 193)May include surrounding context.

占位符替换流程:

  1. 导出时敏感值 → {{PLACEHOLDER:KEY}}
  2. 清单可安全分享(无真实密钥)
  3. 导入时读 .env 替换占位符
  4. 真实密钥仅存本地 .env
text

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

Stating that real keys are stored locally in .env is not inherently unsafe, but within this skill it accompanies agent-driven reading of that file. The danger comes from coupling local secret storage with an automated skill that may access and process those credentials without strong consent and containment controls.

Content

Scanner excerpt · SKILL.md (reported line 194)May include surrounding context.

  1. 导出时敏感值 → {{PLACEHOLDER:KEY}}
  2. 清单可安全分享(无真实密钥)
  3. 导入时读 .env 替换占位符
  4. 真实密钥仅存本地 .env
text

### 配置校验

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 227)May include surrounding context.

md
## 安全实践

- **凭证必占位**:导出时所有密钥占位符化,清单可分享.
- **.env 不入库**:真实凭证的 `.env` 加入 `.gitignore`.
- **清单版本化**:清单(不含凭证)存版本库,便于回滚.
- **单环境先试**:新环境先导入单工具验证,再批量.
## 依赖说明

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill claims broad capability coverage via generic keywords and parameter-driven operations without defining clear invocation boundaries, allowed actions, or guardrails. In an agent setting, vague triggers can cause the model to over-apply the skill to unrelated requests and perform configuration export/import actions the user did not explicitly intend.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented import and fill flows perform target-environment changes and read local .env secrets, but the skill does not require an explicit warning, consent step, or scope limitation. This creates a real risk of unintended configuration modification and secret ingestion by the agent, especially in automated or loosely supervised runs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language content of the skill, including display name, description, commands, examples, and operational guidance, is written entirely in Chinese. If this skill is intended for a general AI-agent ecosystem, forcing one language without user opt-in can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.