Back to skill

Security audit

huawei-cloud-dms-list

Security checks for vulnerabilities and agentic risk

Overview

This cloud inventory skill needs review because it requires extra downloaded telemetry software without explaining what information it sends.

Review the telemetry component before installing this version. Prefer a version that makes telemetry installation and execution optional, documents what it sends and where, and authenticates a pinned release independently. Setting SKILL_QUALITY_REPORT=0 does not establish that installation or wrapper execution is avoided. Use an isolated environment, credentials limited to dms:instance:list, and trusted executable configuration. All bundled files were inspected; the downloaded software remains outside this review, and no malicious payload or actual data theft was established.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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 (19)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The inventory-only description omits mandatory installation and execution of an additional telemetry component, expanding the workflow to persistent host changes and remotely supplied code. The body does disclose this dependency, so it is not wholly concealed, but the DMS write-intent guard does not constrain the installer or wrapper's access to the credential-bearing environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The read-only inventory framing does not capture the installation of executables and supporting modules into the user's persistent executable directory. Although telemetry is mentioned later in the document, making this unrelated component mandatory expands the trust boundary beyond Huawei DMS GET requests and exposes the host if the downloaded release is compromised.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The chunk concerns setup of skill-quality-cli rather than Huawei Cloud instance discovery. Nothing supplied connects that tool to KooCLI, the Huawei Cloud SDK fallback, or another supporting part of the declared workflow. This is an undeclared, unrelated installation capability. The assessment is limited to the visible commands and comments; the contents and side effects of the referenced installation scripts cannot be verified.

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 script, but that JSON selects the executable package subsequently installed. Because both the package URL and expected digest come from the same mutable, unsigned manifest, compromise of that release channel can produce an accepted malicious installation despite the checksum validation.

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, 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 skill mandates unrelated telemetry tooling and automatic installation for a read-only DMS inventory task.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

An unrelated telemetry executable is made a prerequisite for a task that only needs DMS read access, with automatic installation if absent. This unnecessarily introduces remotely supplied code into an environment that may contain cloud credentials; disabling reporting does not necessarily avoid installing or executing the wrapper.

Content

No source excerpt is available for this finding.

Mandatory telemetry wrapping lacks a meaningful privacy disclosure.

Medium
Category
Output Handling
Confidence
93% confidence
Finding

All hcloud commands must pass through telemetry tooling, but the document does not specify collected fields, reporting destinations, redaction, or retention. The wrapper can observe command arguments and potentially inventory output, creating an inadequately disclosed confidentiality risk; the supplied material does not establish that secrets are actually transmitted.

Content

No source excerpt is available for this finding.

The installation instructions execute a downloaded shell script without warning about its local system impact.

Medium
Category
Output Handling
Confidence
89% confidence
Finding

The instructions download a mutable latest installer and immediately execute it without a pinned version or independent integrity verification. HTTPS reduces transit risk, but a compromised distribution endpoint could still deliver arbitrary code with the invoking user's privileges; the installation heading alone does not establish informed approval of those effects.

Content

No source excerpt is available for this finding.

The guide mandates installing and executing an undeclared quality-telemetry component for all KooCLI calls.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The guide explicitly requires an additional telemetry executable and forbids direct hcloud use if installation fails, unnecessarily coupling credentialed inventory work to unrelated tooling. The component is declared in this guide, contrary to that part of the finding, but neither telemetry data handling nor a functional bypass is provided.

Content

No source excerpt is available for this finding.

Automatically downloads and installs an unrelated skill-quality CLI outside the DMS-listing scope.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

This helper automatically installs persistent executable code from a mutable remote manifest, expanding an inventory task into host software installation. SHA256 checking and archive path/link checks are useful defenses, but an attacker controlling the manifest can supply both a malicious package and its matching digest.

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; }

The skill includes an installer for an unrelated skill-quality-cli executable.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest describes listing DMS instances using KooCLI or the Huawei Cloud SDKs, but this script downloads a separate skill-quality-cli package (L26–L48) and installs executable files and supporting modules under ~/.local/bin (L78–L88). Installing this unrelated tool is not required for DMS inventory and is not declared in the manifest; manual invocation and checksum verification do not resolve that purpose mismatch.

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_dms.py (reported line 264)May include surrounding context.

python
cmd.extend(extra)
    cmd.extend(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 258, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
86% confidence
Finding

DMS_LIST_HCLOUD_BIN selects an arbitrary executable, and DMS_LIST_HCLOUD_ARGS supplies arguments before the fixed read-only operation, without either being checked by the guards. If an attacker can influence these environment variables in an agent or job configuration, they can run code with the process's privileges and inherited cloud credentials; shell=False does not prevent execution of an attacker-selected program. This is a conditional configuration trust-boundary issue, not an exploit through ordinary instance-name arguments, and its significance is reduced if the execution environment is exclusively trusted.

Content

Scanner excerpt · scripts/list_dms.py (reported line 264)May include surrounding context.

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

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · tests/test_list_dms.py (reported line 386)May include surrounding context.

python
env = self._clean_env(HUAWEI_ACCESS_KEY="ak", HUAWEI_SECRET_KEY="sk",
                              HUAWEI_PROJECT_ID="proj")
        with mock.patch.dict(os.environ, env, clear=True):
            client = __import__("list_dms")._sdk_client("rabbitmq", "cn-north-4")
        self.assertEqual(client._credentials.ak, "ak")
        self.assertEqual(client._credentials.sk, "sk")
        self.assertEqual(client._credentials.project_id, "proj")

Acceptance criteria require Chinese-language output without user language choice or a documented locale justification.

Low
Category
Output Handling
Confidence
98% confidence
Finding

Lines 14, 15, and 18 explicitly require Chinese error hints, while lines 7–8 prescribe Chinese messages and table labels. These requirements impose a specific output language without offering user opt-in or documenting why the skill requires that locale.

Content

No source excerpt is available for this finding.

Empty instance lists are treated as successful results, contrary to the manifest's explicit non-zero error contract.

Low
Category
Excessive Agency
Confidence
100% confidence
Finding

The manifest explicitly includes empty instance lists among error scenarios that must produce a hint and a non-zero exit. At L732–L734, an empty list instead returns 0; with --json, L728–L730 prints [] and returns 0 before the empty-list hint is reached.

Content

No source excerpt is available for this finding.

Empty instance lists are treated as successful despite the manifest promising a non-zero exit.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest explicitly includes empty instance lists among conditions that produce a non-zero exit. However, L473–L479 invoke main with empty results for both engines and assert exit code 0, establishing a success contract that contradicts the declared behavior and prevents exit-code-based callers from detecting this condition.

Content

No source excerpt is available for this finding.