Back to skill

Security audit

huawei-cloud-kms-key-list

Security checks for vulnerabilities and agentic risk

Overview

This read-only key inventory skill requires review because it mandates downloaded telemetry software without explaining what data it collects.

Review the telemetry software and its data handling before installation, or request a version that allows direct inventory execution without it. The remote payload is absent, so neither its reporting behavior nor its documented opt-out could be verified. Use dedicated read-only cloud credentials and independently check inventory completeness before relying on these results for an audit. All bundled files were inspected; the evidence supports Review rather than a finding of malicious intent.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (20)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The required quality-tool installation introduces remote software and persistent local changes unrelated to listing KMS keys. The body does disclose this dependency, so it is not wholly hidden, but requiring it still exposes a read-only inventory session to an additional software supply chain.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill mandates an unrelated telemetry wrapper and directs installation beyond the KMS inventory task, expanding the trusted execution boundary in a credential-bearing environment. Although the dependency is disclosed in the body, the blanket no-files-written assurance obscures persistent installation effects, and the supplied material does not establish what the wrapper collects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared purpose is a narrowly scoped, strictly read-only KMS inventory tool, but the supplied command delegates to a generic Huawei Cloud CLI invocation. No visible validation confines the service or operation or rejects writes. This materially broader execution surface conflicts with the read-only guarantee. The snippet does not establish that a write actually occurs, and any restrictions inside skill-quality-cli cannot be verified from the supplied code.

Content

No source excerpt is available for this finding.

The skill automatically downloads and installs an unrelated skill-quality CLI outside its KMS inventory purpose.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

When invoked without an existing usable installation, this helper downloads and installs unrelated executable software without a separate consent step. SHA256 verification and archive path checks are useful safeguards, but the same mutable manifest supplies both the artifact location and digest, leaving release-source compromise able to introduce code into subsequent wrapped executions.

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 mutable manifest controls the executable archive installed later. Because its download URL is unrestricted and its digest comes from the same source, compromise of the release service can supply a matching malicious package that runs when the installed CLI is invoked.

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

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_list_kms_keys.py (reported line 137)May include surrounding context.

python
class Base(unittest.TestCase):
    def setUp(self):
        self._env = dict(os.environ)
        for name in kms.HCLOUD_BIN_ENV + ("HUAWEICLOUD_SDK_AK",
                                          "HUAWEICLOUD_SDK_SK",
                                          "HUAWEI_ACCESS_KEY",

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_write, network, 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 documented execution path mandates an unrelated telemetry tool beyond the manifest's read-only KMS inventory scope.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The mandatory wrapper diverts execution through software that is unnecessary for the requested KMS inventory. That software can execute with the caller's privileges and inherited credentials; its implementation and reporting payload are not provided, so actual exfiltration is not established.

Content

No source excerpt is available for this finding.

The one-click installation instructions execute a downloaded shell script without warning about its system-level effects.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The recommended commands download a mutable latest installer and immediately execute it with unattended approval, without artifact verification or a review step. HTTPS and the apparent vendor hosting reduce interception risk, but a compromised distribution source could still execute arbitrary code with the user's privileges.

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 unrelated remote software installer that persists executable files in the user's environment.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

L26-L48 fetch a release manifest and download skill-quality-cli, while L78-L88 install or overwrite executable files and supporting modules under ~/.local/bin. Installing this separate quality tool is not justified by the manifest's KMS inventory purpose or its declared KooCLI/SDK execution paths. The script is explicitly manually invoked, but that limits automatic exposure rather than making this capability part of the declared skill scope.

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

python
)
    cmd = [binaries] + list(args)
    try:
        proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
    except subprocess.TimeoutExpired:
        raise KmsError(
            "timeout",

Tainted flow: 'cmd' from os.environ.get (line 138, 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_kms_keys.py (reported line 140)May include surrounding context.

python
)
    cmd = [binaries] + list(args)
    try:
        proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
    except subprocess.TimeoutExpired:
        raise KmsError(
            "timeout",

Pagination can silently return an incomplete KMS inventory while marking the merged result as complete.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

Both pagination backends can stop at max_pages, or when a truncated response lacks a continuation marker, without reporting that the inventory is incomplete. merge_pages then unconditionally emits truncated=false and an empty next_marker, allowing security audits or downstream automation to mistake a partial KMS inventory for a complete one; this affects inventory integrity rather than permitting key mutation or key-material disclosure.

Content

No source excerpt is available for this finding.

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 · scripts/list_kms_keys.py (reported line 291)May include surrounding context.

python
error message about a missing SDK to the credential/client stage.
    """
    try:
        module = __import__("huaweicloudsdkkms.v2", fromlist=[name])
        request = getattr(module, name)()
    except Exception:
        request = SimpleNamespace()

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · tests/test_list_kms_keys.py (reported line 79)May include surrounding context.

python
self.fail_op = fail_op
        self.calls = []

    def __call__(self, args, timeout=None):
        self.calls.append(list(args))
        operation = args[1] if len(args) > 1 else ""
        if self.error is not None and (self.fail_op is None

Acceptance criteria require Chinese user-facing messages without a language choice.

Low
Category
Output Handling
Confidence
90% confidence
Finding

The empty-list and no-match acceptance criteria prescribe Chinese output strings rather than language-neutral message requirements. No user language choice or justification for a Chinese-only locale constraint is provided.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/list_kms_keys.py (reported line 292)May include surrounding context.

python
"""
    try:
        module = __import__("huaweicloudsdkkms.v2", fromlist=[name])
        request = getattr(module, name)()
    except Exception:
        request = SimpleNamespace()
    for key, value in fields.items():

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/list_kms_keys.py (reported line 319)May include surrounding context.

python
pass
    data = {}
    for attr in ("keys", "key_details", "total", "truncated", "next_marker"):
        value = getattr(response, attr, None)
        if value is None:
            continue
        if isinstance(value, list) and value and hasattr(value[0], "to_dict"):