Back to skill

Security audit

huawei-cloud-ecs-export-markdown

Security checks for vulnerabilities and agentic risk

Overview

Review before installing: cloud queries are read-only, but setup weakens download security and enables usage reporting with unclear data handling.

Set SKILL_QUALITY_REPORT=0 and skip the quality-CLI installers unless you have separately reviewed that program and its reporting policy. Install needed SDK packages through a certificate-verified package source instead of the supplied environment helper. Use credentials limited to ECS listing and protect exported inventory files. The downloaded reporting program remains outside this inspection, so its data handling could not be verified.

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/ensure_env.py
Finding

SDK installation disables TLS certificate verification for package mirrors

Content
View full analysis

Impact

A substituted SDK package can execute code with the invoking user's privileges during installation or the immediate import, allowing access to local files and available cloud credentials.

Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (15)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Preparing the reporting workflow can install a separate executable that subsequently wraps credentialed cloud commands, expanding trust beyond the ECS client and local exporter. The installation is disclosed in the document body, so it is not wholly hidden, but the read-only cloud guard does not constrain downloaded code or its access to local credentials.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The auxiliary installer introduces persistent executable code unrelated to producing the instance report, and that code is later used around cloud CLI execution. Documentation acknowledges the dependency, which reduces deception concerns, but does not eliminate the additional supply-chain and credential-access exposure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

Default-enabled reporting introduces an outbound data path beyond the advertised local inventory export and places a reporting wrapper around cloud commands. The documents disclose an opt-out, but the provided sources do not establish the telemetry payload or redaction rules; leakage of credentials or instance records is therefore a risk, not a demonstrated event.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

The matched request fetches JSON rather than directly executing a shell script, but the complete flow installs executable code chosen by that mutable manifest. Because the manifest supplies both the download URL and checksum, compromise of that release channel permits malicious replacement code despite successful SHA256 verification; manual invocation and archive validation reduce, but do not remove, this exposure.

Content

Scanner excerpt · scripts/install_cli.sh (reported line 28)May include surrounding context.

sh
API_URL="https://skillsapi.developer.myhuaweicloud.com/api/quality/cli/latest"

manifest="$(curl -fsSL --connect-timeout 5 --max-time 20 "${API_URL}")"
v="$(printf '%s' "$manifest" | python3 -c 'import sys,json;print(json.load(sys.stdin)["version"])')"
case "$(uname -s)" in
    Linux) ;;

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The guide documents automatic, opt-out quality telemetry unrelated to listing ECS instances or exporting a local report.

Medium
Category
Excessive Agency
Confidence
92% confidence
Finding

The guide directs use of opt-out telemetry around a credentialed ECS inventory command, creating an additional data-processing boundary unnecessary for local export. Disclosure and a disable switch mitigate surprise, but there is no supplied payload specification demonstrating that sensitive arguments and cloud responses are excluded.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/ensure_cli.sh (reported line 89)May include surrounding context.

sh
echo "警告: 解压失败或 tar 包含不安全条目, 拒绝安装" >&2
        return 1
    fi
    mkdir -p ~/.local/bin/skill-quality-cli.d || { echo "警告: 创建安装目录失败" >&2; return 1; }
    [ -f "${tmp}/skill-quality-cli" ] || { echo "警告: 安装包内容缺失(skill-quality-cli)" >&2; return 1; }
    # 主二进制: 复制/可执行位失败必须显式失败(不再静默吞错)
    cp "${tmp}/skill-quality-cli" ~/.local/bin/skill-quality-cli || { echo "警告: 复制 skill-quality-cli 失败" >&2; return 1; }

Automatically installs an unrelated quality CLI outside the ECS export workflow.

Medium
Category
Excessive Agency
Confidence
93% confidence
Finding

When invoked as environment preparation, this helper installs a mutable latest release into the user's executable directory without a separate approval step. HTTPS, mandatory SHA256 verification, and archive path checks are meaningful safeguards, but a compromised manifest can select both malicious code and its matching digest; the resulting wrapper can run with access to the user's cloud environment.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/ensure_env.py (reported line 76)May include surrounding context.

python
def run_cmd(cmd, timeout=300):
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=timeout, universal_newlines=True,
        )

Installs an unrelated quality-assessment CLI persistently in the user's executable directory.

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The script contacts a quality-service endpoint, downloads its selected release, and installs executable files under ~/.local/bin. Exporting ECS inventory requires KooCLI or the ECS SDK, not installation of a separate skill-quality tool; the manifest's mention of wrapper tests does not declare this installation capability. Manual invocation and checksum verification reduce risk but do not justify the additional capability.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install_cli.sh (reported line 78)May include surrounding context.

sh
echo "错误: 解压失败或 tar 包含不安全条目, 拒绝安装" >&2
        exit 1
    fi
mkdir -p ~/.local/bin/skill-quality-cli.d
cp "${tmp}/skill-quality-cli" ~/.local/bin/skill-quality-cli || { echo "错误: 复制 skill-quality-cli 失败" >&2; exit 1; }
chmod +x ~/.local/bin/skill-quality-cli || { echo "错误: 设置可执行位失败" >&2; exit 1; }
if [ -f "${tmp}/skill-quality-cli.bin" ]; then

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/list_ecs_export_markdown.py (reported line 387)May include surrounding context.

python
guard_write_intent(" ".join(extra))
    cmd = build_hcloud_command(argv)
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=120, universal_newlines=True,
        )

Tainted flow: 'cmd' from os.environ.get (line 385, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/list_ecs_export_markdown.py (reported line 387)May include surrounding context.

python
guard_write_intent(" ".join(extra))
    cmd = build_hcloud_command(argv)
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=120, universal_newlines=True,
        )

The report format mandates Chinese-language text without offering a language choice.

Low
Category
Output Handling
Confidence
95% confidence
Finding

The skill requires a Chinese report heading and Chinese summary text, alongside fixed Chinese column headers. It provides no language opt-in or locale selection and does not justify restricting the report language.

Content

No source excerpt is available for this finding.

Report labels are fixed to Chinese without a language choice or documented locale justification.

Low
Category
Output Handling
Confidence
94% confidence
Finding

The report headers and title are hard-coded in Chinese, and the renderer also uses Chinese metadata and summary labels at L088–L099. No language option or locale-specific justification is provided, so the generated report imposes a language without user opt-in.

Content

No source excerpt is available for this finding.