Back to skill

Security audit

Tencent Cloud COS

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its Tencent COS purpose, but its setup process handles cloud credentials and local execution in ways users should review carefully before installing.

Install only if you are comfortable reviewing and hardening the setup first. Prefer a dedicated least-privilege Tencent CAM key, avoid pasting broad cloud credentials into chat, do not store long-lived secrets in shell startup files or command arguments, keep HTTPS enabled, avoid custom service domains unless required, and pin or vet package versions before running setup.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup.sh:365
Finding

Arbitrary Command Execution Through eval-Based COSCMD Configuration

Content
View full analysis
/dev/null && \ ok "coscmd configured" || \ warn "coscmd installation/configuration failed" ``` ### Technical Analysis The script concatenates user-controlled setup values into a single command string and executes that string with `eval`. The affected values include the secret ID, secret key, bucket, region, and optional service domain. Shell metacharacters embedded in any of these values are treated as command syntax when `eval` reparses the string. Quoting the arguments when initially invoking `setup.sh` does not prevent exploitation because the quotes are removed during initial argument parsing, and the resulting value is later evaluated as shell source. For example, a malicious service-domain value containing a command separator can terminate the intended `coscmd` argument and append an arbitrary command. ### Attack Path 1. An attacker supplies or convinces a user to use a crafted setup value, such as a malicious `--service-domain`. 2. `do_setup` stores the value in `SERVICE_DOMAIN`. 3. The script concatenates it into `COSCMD_ARGS`. 4. `eval` reparses the resulting text as a shell command. 5. Shell metacharacters in the supplied value execute an attacker-selected command. 6. The command runs with the privileges of the user executing `setup.sh`. ### Impact Assessment Successful exploitation provides arbitrary local command execution under the account running the setup script. An attacker could: - Read or alter files available to that user. - Steal the Tencent COS credentials handled by t ...[truncated 351 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup.sh:244
Finding

Persistent Shell Startup Injection Through Unescaped Configuration Values

Content
View full analysis
> "$SHELL_RC" << EOF # --- Tencent COS Skill --- export TENCENT_COS_SECRET_ID="$SECRET_ID" export TENCENT_COS_SECRET_KEY="$SECRET_KEY" export TENCENT_COS_REGION="$REGION" export TENCENT_COS_BUCKET="$BUCKET" EOF if [ -n "$DATASET" ]; then sed -i.bak '/^# --- End Tencent COS Skill ---$/d' "$SHELL_RC" rm -f "${SHELL_RC}.bak" cat >> "$SHELL_RC" << EOF export TENCENT_COS_DATASET_NAME="$DATASET" EOF fi if [ -n "$DOMAIN" ]; then sed -i.bak '/^# --- End Tencent COS Skill ---$/d' "$SHELL_RC" rm -f "${SHELL_RC}.bak" cat >> "$SHELL_RC" << EOF export TENCENT_COS_DOMAIN="$DOMAIN" EOF fi if [ -n "$SERVICE_DOMAIN" ]; then sed -i.bak '/^# --- End Tencent COS Skill ---$/d' "$SHELL_RC" rm -f "${SHELL_RC}.bak" cat >> "$SHELL_RC" << EOF export TENCENT_COS_SERVICE_DOMAIN="$SERVICE_DOMAIN" EOF fi if [ -n "$PROTOCOL" ]; then sed -i.bak '/^# --- End Tencent COS Skill ---$/d' "$SHELL_RC" rm -f "${SHELL_RC}.bak" cat >> "$SHELL_RC" << EOF export TENCENT_COS_PROTOCOL="$PROTOCOL" EOF fi echo "# --- End Tencent COS Skill ---" >> "$SHELL_RC" ``` ### Technical Analysis Setup values are inserted directly into `.bashrc` or `.zshrc` within double-quoted `export` statements. The values are not encoded or safely escaped for use as shell source. A value containing a double quote can leave the intended string context. A value containing command substitution such as `$(...)` remains executable when the startup file is later sourced. Embedded newlines can also create entirely new shell commands. Unlike immediate command injection, this issue writes the payload into a shell startup file. The payload can therefore execute repeatedly whenever the user starts a new interactive shell or another process sources that file. ### Attack Path 1. An attacker provides a crafted secret, da ...[truncated 987 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup.sh:307
Finding

Arbitrary JavaScript Execution Through node -e Source Interpolation

Content
View full analysis
/dev/null; then warn "Existing cos-mcp configuration will be updated" fi node -e " const fs = require('fs'); const configPath = '$MCPORTER_CONFIG'; let config = {}; try { config = JSON.parse(fs.readFileSync(configPath, 'utf-8')); } catch(e) {} if (!config.mcpServers) config.mcpServers = {}; config.mcpServers['cos-mcp'] = { command: 'npx', args: [$COS_MCP_ARGS] }; fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); " 2>/dev/null fi ``` ### Technical Analysis The script constructs JavaScript string literals from setup values and inserts the resulting text directly into a program executed by `node -e`. This treats configuration data as executable source code. A malicious value containing quotes and JavaScript syntax can terminate the intended string literal and inject expressions or statements into the generated Node.js program. The Node.js process has the same filesystem and process privileges as the setup script and can invoke child processes, read credentials, and modify files. The same pattern also interpolates `MCPORTER_CONFIG` into a JavaScript single-quoted string, although that path is der ...[truncated 1109 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup.sh:244
Finding

Long-Lived Cloud Credentials Stored in Plaintext and Exposed as Process Arguments

Content
View full analysis
> "$SHELL_RC" << EOF # --- Tencent COS Skill --- export TENCENT_COS_SECRET_ID="$SECRET_ID" export TENCENT_COS_SECRET_KEY="$SECRET_KEY" export TENCENT_COS_REGION="$REGION" export TENCENT_COS_BUCKET="$BUCKET" EOF ``` ```bash local COS_MCP_ARGS="\"cos-mcp\", \"--Region=$REGION\", \"--Bucket=$BUCKET\", \"--SecretId=$SECRET_ID\", \"--SecretKey=$SECRET_KEY\"" ``` The generated MCP configuration consequently uses arguments in this form: ```json { "command": "npx", "args": [ "cos-mcp", "--SecretId=", "--SecretKey=", "--connectType=stdio" ] } ``` ### Technical Analysis The setup process persists Tencent cloud credentials in plaintext in the user's shell startup file and embeds the same credentials into the MCP command argument list. No explicit restrictive permissions are applied to the shell startup file or `~/.mcporter/mcporter.json`. Moreover, command-line secrets can be exposed to local process-inspection mechanisms while the MCP process is running. Plaintext credentials may also leak through backups, diagnostic bundles, configuration sharing, or accidental source-control inclusion. The project documentation labels environment-based secret delivery as recommended, but the automated setup implementation instead generates command arguments containing the secrets. ### Attack Path 1. A user runs setup with valid Tencent credentials. 2. The script writes the credentials into `.bashrc` or `.zshrc`. 3. The script writes the credentials into `~/.mcporter/mcporter.json` as MCP arguments. 4. A local process, another user with sufficient read permissions, backup reader, or diagnostic collector obtains one of those files or observes the process arguments. 5. The attacker reuses the credentials against Tenc ...[truncated 636 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/setup.sh:71
Finding

Unpinned Third-Party Packages Are Downloaded and Executed During Setup and Checks

Content
View full analysis
/dev/null && npx cos-mcp --help &>/dev/null 2>&1; then ``` ```bash (cd "$BASE_DIR" && npm install cos-mcp cos-nodejs-sdk-v5 --no-progress 2>&1 | tail -3) if ! command -v mcporter &>/dev/null; then npm install -g mcporter --no-progress 2>&1 | tail -3 if command -v mcporter &>/dev/null; then ok "mcporter globally installed" else (cd "$BASE_DIR" && npm install mcporter --no-progress 2>&1 | tail -3) fi fi ``` ```bash PIP_CMD=$(command -v pip3 || command -v pip) $PIP_CMD install coscmd -q 2>/dev/null ``` ### Technical Analysis The script installs `cos-mcp`, `cos-nodejs-sdk-v5`, `mcporter`, and `coscmd` without exact version constraints, package hashes, or a committed lockfile. npm package lifecycle scripts may run during installation, and the installed CLIs are subsequently executed. The check-only path also calls `npx cos-mcp --help`. Depending on npm/npx behavior and local package availability, this can download and execute the current registry version merely while performing an environment check. A global `mcporter` installation increases the affected scope and can alter tooling outside the project directory. No evidence in the reviewed project proves that the named packages are malicious. The vulnerability is the uncontrolled trust placed in mutable upstream package versions and install-time code. ### Attack Path 1. An upstream package account, registry artifact, dependency, or newly selected package version becomes compromised. 2. A user runs setup or the check-only operation. 3. npm, npx, or pip retrieves the unpinned current package version. 4. Package installation hooks or CLI entry points execute locally. 5. Malicious upstream code gains the privileges and data access of the user running the Skill. # ...[truncated 562 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cos_node.mjs:27
Finding

Arbitrary Service Endpoints and Plaintext HTTP Are Accepted for Signed COS Requests

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (16)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill asks the user to provide SecretId and SecretKey directly, but does not clearly warn beforehand that these are highly sensitive cloud credentials or explain safer handling expectations. In context, these credentials grant access to cloud storage and related services, so collecting them without explicit security guidance materially increases the risk of credential exposure, accidental logging, or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill states that credentials will be written to ~/.zshrc or ~/.bashrc for persistence, but does not prominently warn that this stores long-lived secrets in local shell startup files. Persisting cloud secrets in broadly used plaintext config files increases the blast radius of compromise through local account access, backups, history leakage, or later accidental disclosure.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. **方式二:Node.js SDK 脚本** — 通过 `scripts/cos_node.mjs` 执行存储操作

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. **方式二:Node.js SDK 脚本** — 通过 `scripts/cos_node.mjs` 执行存储操作

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. **方式二:Node.js SDK 脚本** — 通过 `scripts/cos_node.mjs` 执行存储操作

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script appends TENCENT_COS_SECRET_ID and TENCENT_COS_SECRET_KEY directly into ~/.bashrc or ~/.zshrc, persisting long-lived cloud credentials in plaintext. Any local compromise, accidental file sharing, backups, shell history exposure, or other tooling that reads dotfiles can leak these secrets and enable unauthorized access to the user's COS bucket and related cloud resources.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script writes COS credentials into ~/.mcporter/mcporter.json as command arguments, storing secrets in another plaintext file and potentially exposing them to local users, backups, desktop search, and process inspection depending on how the tool launches. Because these credentials grant direct access to cloud storage, disclosure can lead to data theft, tampering, or deletion.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill declares installation and operational behaviors that rely on environment-based credentials and shell configuration, but it does not declare any explicit tool scope or permissions boundary. In a skill that handles cloud secrets and file operations, missing scope increases the chance the agent can access or manipulate sensitive environment data without clear least-privilege constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructions and user-facing guidance are entirely in Chinese, including the prescribed prompts to the user, with no indication that another language can be used. This creates a locale/language policy concern because it imposes a language preference without explicit user opt-in or justification as a China-only compliance requirement.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation condition 'when the user first requests COS operations' is broad enough that an agent may invoke setup or credential-collection flows on loosely related storage tasks without strong confirmation. Because this skill can install packages, modify configs, and solicit secrets, ambiguous triggering raises the risk of unnecessary privileged actions and over-collection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

这是一个 markdown 文件,适用 SQP-2 的文档检查标准。该参考文档列出了上传本地文件、下载到本地、删除对象、递归强制删除以及写入 ~/.cos.conf 等会影响用户数据或系统状态的操作,但未提醒这些命令会修改本地文件、云端对象或持久化凭证配置。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

User-facing comments, status messages, errors, and usage instructions are consistently presented in Chinese, with no option to select another language. This can violate language or locale policy when a skill imposes a specific language without opt-in or a clearly documented regional constraint.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The script invokes npx cos-mcp --help without pinning a package version, so execution depends on whatever version resolves at runtime. In a setup script for cloud storage access, this creates supply-chain risk: a malicious or compromised upstream package version could run code during installation or execution with the user's privileges.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

SQP-3 适用于所有文件类型,包含自然语言中的语言/区域政策问题。该文件全文以中文撰写,未说明这是面向特定中文用户群体的限定文档,也未提供用户可选择其他语言版本的说明。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language descriptions, comments, and parameter explanations in this template are entirely in Chinese, and the file does not offer an alternative language or indicate that the locale is intentionally region-specific. Under the policy rule for language or locale constraints, this is a natural-language policy issue because users are not given a language choice or opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.