Back to skill

Security audit

huawei-cloud-cdm-list

Security checks for vulnerabilities and agentic risk

Overview

The cloud queries are read-only, but setup disables download security checks and the telemetry tool’s data handling is unspecified.

Review before installing. Install SDK dependencies in an isolated environment with certificate verification enabled instead of using the supplied installer unchanged. Use credentials limited to CDM read access. Set SKILL_QUALITY_REPORT=0 and skip the optional quality-tool installation until its collection behavior and destination are documented. Downloaded telemetry code remains unverified, and exported reports contain infrastructure details.

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

Error
Location
scripts/ensure_env.py
Finding

Dependency installation disables TLS certificate verification for package mirrors

Content
View full analysis

Impact

Attacker-supplied package code can execute during installation or the subsequent import, gaining access to files and environment credentials available to the process.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (16)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The only supplied executable command is python3 -m unittest discover -s tests -v. Although test execution could support development of the described skill, this chunk provides only a test runner, not the declared operational functionality. Its visible primary behavior therefore differs materially from the description. The contents and effects of the discovered tests cannot be determined from the supplied code.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied chunk performs software installation, not CDM cluster inspection. Installing skill-quality-cli is not identified as a dependency or supporting component of the declared KooCLI/CDM SDK workflow. Its checksum and extraction checks reduce installation risks but do not resolve the undeclared capability. The script does not itself execute the downloaded tool or demonstrate cloud-resource mutation; the mismatch is the unrelated network download and persistent local installation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied chunk is an installer for a separate quality CLI, not an implementation of CDM cluster queries. Its persistent executable installation is a substantive undeclared capability, rather than a minor implementation detail of the stated KooCLI/SDK read-only workflow. SHA256 verification and archive checks reduce installation risk but do not resolve the description-behavior mismatch. No CDM operations or credential access are shown, and the downloaded tool's subsequent behavior cannot be established from this chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The primary cloud-query purpose is accurately represented, and the visible code constructs only the two declared read-only CDM API operations. However, the default-enabled quality-reporting integration adds a separate reporting behavior not disclosed in the description. The supplied code establishes invocation of that reporting tool, but not its internal data handling or whether it transmits anything remotely. The documented output interface also differs materially from implementation: shorthand format switches are absent, file creation is automatic for non-table formats, and table export is not implemented.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

CLI installation could be a supporting implementation detail, but upgrading skill-quality-cli introduces an undeclared tool-management capability unrelated to the stated CDM functionality. The snippet performs no CDM queries. The referenced scripts are not supplied, so their internal behavior cannot be determined, and the telemetry-disable setting does not establish that telemetry is actually collected or transmitted.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

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_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.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 16)May include surrounding context.

curl -LO https://cli.dev.huaweicloud.com/koolci/hcloud-linux-amd64-latest.zip unzip hcloud-linux-amd64-latest.zip chmod +x hcloud sudo mv hcloud /usr/local/bin/ hcloud --version

text

The script automatically installs an unrelated skill-quality CLI outside the CDM query skill's declared purpose.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest describes read-only CDM queries through KooCLI or the CDM SDK, plus optional result exports. Instead, L037–L059 fetch a separate skill-quality-cli release manifest and archive, and L089–L101 persist executable files and supporting modules under ~/.local/bin; installing this unrelated tool is neither declared nor necessary for those queries. SHA256 verification protects download integrity but does not justify the additional installation 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/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; }

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

The subprocess call uses an argument list without a shell, so it is not itself a command-injection vulnerability. However, its pip-install caller explicitly supplies --trusted-host for both preferred package mirrors, disabling HTTPS certificate verification for those hosts; a network attacker able to intercept that traffic could substitute executable SDK packages, which would later run in a cloud-credential-bearing environment.

Content

Scanner excerpt · scripts/ensure_env.py (reported line 56)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,
        )

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

Installs an unrelated skill-quality CLI into the user's executable directory.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The script downloads a skill-quality-cli package from a separate quality-service endpoint (L26–L48), then installs or overwrites executable files and supporting modules under ~/.local/bin. This persistent software-installation capability is unrelated to querying CDM clusters through KooCLI or the CDM SDK and is not declared in the manifest. Manual invocation and SHA256 verification do not establish its relevance to the skill's stated purpose.

Content

No source excerpt is available for this finding.

CDM queries are automatically routed through an undeclared telemetry executable when it is available.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

Telemetry is enabled by default and silently routes cloud queries through skill-quality-cli discovered on PATH or in ~/.local/bin, despite telemetry not being disclosed in the skill metadata. This introduces an additional executable into an authenticated workflow with inherited environment credentials and potential access to cluster output; read-only cloud operations do not prevent confidentiality loss through that wrapper. The supplied file does not establish what the wrapper collects or prove actual exfiltration.

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/list_cdm_clusters.py (reported line 447)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 445, 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_cdm_clusters.py (reported line 447)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,
        )