Back to skill

Security audit

huawei-cloud-ces-list

Security checks for vulnerabilities and agentic risk

Overview

This is a read-only Huawei Cloud monitoring skill, but it needs Review because it handles cloud credentials in overly broad and process-visible ways and documents an unverified remote installer.

Install only after reviewing the credential flow. Prefer a scoped, read-only Huawei IAM identity, avoid running this where other Huawei-like secrets are present, do not pass long-lived AK/SK through process-visible command arguments if a safer hcloud profile or secret mechanism is available, and verify or pin the hcloud installer before executing it.

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

T09 · Insecure Skill Coding Practices

Error
Location
huawei-cloud-ces-list.py:130
Finding

Huawei Cloud credentials are exposed through process command-line arguments

Content
View full analysis

Vulnerability Details

File Location: huawei-cloud-ces-list.py, lines 130-140
Vulnerability Type: Sensitive credentials in process arguments
Risk Level: High

Vulnerable Code

python
cmd = [
    "hcloud", service, operation,
    "--cli-access-key=" + ak,
    "--cli-secret-key=" + sk,
] + params

try:
    proc = subprocess.run(
        cmd,
        capture_output=True,
        text=True,
        timeout=HCLOUD_TIMEOUT,
    )

Technical Analysis

The Huawei Cloud access key and secret key are concatenated directly into the hcloud process argument vector. Although subprocess.run is safely invoked without a shell, this does not protect secrets passed through command-line arguments.

Depending on the operating system and process-monitoring configuration, arguments may be observable through process listings, /proc interfaces, endpoint monitoring tools, audit systems, crash diagnostics, or command-execution telemetry. The secret key is a long-lived authentication credential and should not be exposed through a process-visible channel.

This behavior also conflicts with the Skill documentation's assertion that AK/SK credentials are not logged or exposed.

Attack Path

  1. A legitimate user configures Huawei Cloud AK/SK credentials and invokes the Skill.
  2. The Skill starts hcloud with both credentials embedded in its command-line arguments.
  3. During the process lifetime, a local user, monitoring agent, diagnostic collector, or compromised process with sufficient process-inspection access reads the argument vector.
  4. The observer extracts the values of --cli-access-key and --cli-secret-key.
  5. The credentials are reused outside the Skill to authenticate to Huawei Cloud APIs.

Impact Assessment

An attacker who captures the credentials can assume the permissions of the associated Huawei Cloud IAM identity. The immediate documented scope is read access to CES metr ...[truncated 383 chars]

Remediation
View remediation

Remediation Suggestions

  • Use an hcloud authentication mechanism that does not place secrets in the argument vector, such as protected environment variables, standard input, or a permission-restricted credential profile supported by KooCLI.
  • If a temporary configuration file is unavoidable, create it with owner-only permissions, avoid predictable paths, and securely delete it immediately after use.
  • Prefer short-lived or federated credentials instead of long-lived AK/SK pairs.
  • Ensure the IAM identity has only the required CES read permissions.
  • Review process-monitoring, audit, and diagnostic systems for previously captured command lines.
  • Rotate credentials that may already have appeared in process telemetry.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
huawei-cloud-ces-list.py:43
Finding

Overly broad environment scanning can select unrelated or mismatched cloud credentials

Content
View full analysis

Vulnerability Details

File Location: huawei-cloud-ces-list.py, lines 43-52
Vulnerability Type: Ambiguous and excessive credential discovery
Risk Level: Medium

Vulnerable Code

python
ak, sk = "", ""
for key, val in os.environ.items():
    upper = key.upper()
    if not (upper.startswith("HUAWEI") or upper.startswith("HW") or upper.startswith("HWC")):
        continue
    if "ACCESS_KEY" in upper or upper.endswith("_AK") or upper == "AK":
        ak = val or ak
    if "SECRET_KEY" in upper or upper.endswith("_SK") or upper == "SK":
        sk = val or sk
return ak, sk

Technical Analysis

Rather than reading a small set of explicit, documented environment-variable names, the implementation enumerates the entire environment and accepts any variable with a broad HUAWEI, HW, or HWC prefix whose name resembles an access or secret key.

If multiple matching variables are present, later values encountered during environment iteration overwrite earlier values. There is no ambiguity check or guarantee that the selected AK and SK belong to the same credential set. Consequently, the program may consume unrelated secrets, use an unintended cloud identity, or construct a mismatched credential pair.

The selected values are subsequently forwarded through command-line arguments, compounding the exposure described in the preceding finding.

Attack Path

  1. A wrapper script, CI job, container configuration, plugin, or local attacker capable of influencing the process environment adds variables with matching names, such as another HW*_AK and HW*_SK pair.
  2. The Skill enumerates all environment variables and treats the injected or unrelated variables as eligible credentials.
  3. Depending on environment iteration order, those values replace the intended credentials or are combined with a key from another credential set.
  4. The Skill invokes hcloud using the selected credentials.

...[truncated 749 chars]

Remediation
View remediation

Remediation Suggestions

  • Read only explicit documented variables, such as HUAWEICLOUD_SDK_AK and HUAWEICLOUD_SDK_SK.
  • If aliases must be supported, define a fixed ordered list rather than matching broad prefixes.
  • Select AK and SK as a named pair from the same credential namespace.
  • Reject execution when multiple credential pairs are present instead of silently choosing one.
  • Never enumerate or consume unrelated environment secrets.
  • Validate that both values are nonempty without printing or logging them.
  • Combine this fix with a credential transport mechanism that does not expose secrets through process arguments.

T08 · Insecure Dependencies

Warning
Location
cli-installation-guide.md:13
Finding

Installation guide executes an unpinned remote installer without integrity verification

Content
View full analysis

Vulnerability Details

File Location: cli-installation-guide.md, lines 13-16; repeated at lines 29-30
Vulnerability Type: Mutable remote installer without checksum or signature verification
Risk Level: Medium

Vulnerable Code

bash
curl -sSL https://hcloudcli.obs.cn-north-1.myhuaweicloud.com/cli/latest/hcloud_install.sh -o hcloud_install.sh

# Execute installation
bash hcloud_install.sh

The macOS instructions repeat the same pattern:

bash
curl -sSL https://hcloudcli.obs.cn-north-1.myhuaweicloud.com/cli/latest/hcloud_install.sh -o hcloud_install.sh
bash hcloud_install.sh

Technical Analysis

The installation procedure downloads the mutable latest version of a shell script and executes it without checking a cryptographic checksum, digital signature, or pinned release identifier.

HTTPS provides transport protection but does not guarantee that future content at the URL will be identical to the content reviewed during this audit. A compromise of the vendor distribution endpoint, storage bucket, release pipeline, signing process, or account could replace the installer with arbitrary executable content.

The use of curl -sSL also omits --fail, which can make download failures less explicit before the resulting file is passed to the shell.

Attack Path

  1. An attacker compromises the installer hosting location, vendor publishing pipeline, or credentials authorized to update the mutable latest artifact.
  2. The legitimate installer is replaced with or redirected to attacker-controlled shell code.
  3. A user follows the project's documented installation instructions.
  4. curl downloads the modified script without validating its version, checksum, or signature.
  5. bash hcloud_install.sh executes the attacker's code with the privileges of the installing user.
  6. The malicious installer can access user files, environment credentials, cloud keys, or perform any other action ...[truncated 418 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the installation instructions to a specific, reviewed KooCLI release rather than the mutable latest path.
  • Publish and verify a vendor-signed checksum or cryptographic signature before execution.
  • Use curl --fail --show-error --location so HTTP errors terminate the installation process clearly.
  • Prefer a trusted package manager with package-signature verification where available.
  • Do not execute a downloaded script until its origin, version, checksum, and signature have been validated.
  • Document the expected checksum and trusted signing key through an independent authenticated channel.
  • Periodically review and update the pinned version through a controlled dependency-update process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

整体上,代码的主要用途与声明高度一致:它确实只读查询华为云 CES,支持指标列表和指标数据查询,过滤参数、时间范围、聚合粒度与聚合方式也基本符合,认证方式也是从环境变量动态读取 AK/SK。未发现写操作、越权资源访问或明显无关功能。

但声明中有两处与实际行为不一致,且属于功能层面的差异:第一,声明称“JSON 输出全部字段”,而代码并未原样透传全部 API 返回。cmd_list 将结果重组为 count/total/marker/metrics;cmd_show 仅输出 metric_name 和 datapoints,因此若 API 返回其他字段会被丢弃。第二,代码额外提供 capability-list 子命令,可输出该技能支持的操作清单,这属于未在声明中明确提及的附加能力。基于评估标准,这些属于描述与实际行为的不完全一致,应判定为存在 mismatch,不过偏轻微。

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
86% confidence
Finding

The skill scans the entire environment to discover any variables that look like Huawei AK/SK credentials, including very generic names like AK and SK. In an agent/runtime environment that may expose many secrets, this broad harvesting can capture unintended credentials and use them implicitly, creating secret overreach and increasing the blast radius if the skill is triggered in a mixed-tenant or multi-secret context.

Content

Scanner excerpt · huawei-cloud-ces-list.py (reported line 44)May include surrounding context.

python
whose name contains ACCESS_KEY / SECRET_KEY or ends with _AK / _SK.
    """
    ak, sk = "", ""
    for key, val in os.environ.items():
        upper = key.upper()
        if not (upper.startswith("HUAWEI") or upper.startswith("HW") or upper.startswith("HWC")):
            continue

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill explicitly describes use of environment-variable credential discovery and hcloud CLI execution, which implies access to env and shell capabilities, but it declares no tool scope or permission boundaries. In an agent environment, that omission can allow broader-than-intended access or make policy enforcement ambiguous, increasing the risk of credential exposure or unintended command execution paths.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

该 markdown 文件定义了多个触发词,其中“列出监控指标”“华为云云监控”“查看指标数据”等表述较泛,缺少明确的上下文约束、边界条件或负例说明。虽然主题限定在华为云 CES,但这些短语仍可能覆盖普通查询或说明性对话,导致技能被过度触发。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file presents all user-facing acceptance criteria entirely in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy for natural-language violations, forcing a specific language without opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide instructs users to download and immediately execute a remote shell script via curl and bash without any integrity verification, signature check, pinning, or warning about the risks of running fetched code. If the hosting location, network path, or script content is compromised, users could execute arbitrary code on their systems during installation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide recommends placing long-lived cloud AK/SK credentials in environment variables and notes broad variable-name scanning, but gives no warning about exposure through shell history, process inheritance, debugging output, CI logs, or multi-user environments. In this skill context, these credentials can grant cloud API access, so accidental leakage could expose monitoring data and potentially enable broader account abuse depending on IAM permissions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The diagram explicitly describes dynamically scanning environment variables for AK/SK and passing them on the command line via --cli-access-key/--cli-secret-key. Command-line secrets are commonly exposed through process listings, shell history, logs, crash reports, or orchestration telemetry, so documenting this flow without any warning or safer handling guidance reflects an unsafe credential-handling design.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill states that JSON responses are emitted to stdout with all fields preserved, and the data model likewise says API responses include all returned fields. Even for a read-only monitoring skill, unfiltered stdout output can leak sensitive infrastructure metadata such as resource identifiers, dimensions, namespaces, or other provider-returned fields into chat transcripts, logs, pipelines, or downstream tools.

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 · huawei-cloud-ces-list.py (reported line 136)May include surrounding context.

python
] + params

    try:
        proc = subprocess.run(
            cmd,
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file instructs the user to export cloud access credentials directly into environment variables, but it does not include any warning that these values are sensitive secrets or guidance to avoid leaking them in shell history, logs, or shared terminals. For markdown files, credential-handling behavior that affects privacy or system security should be accompanied by an explicit warning.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file’s natural-language content is entirely in Chinese, which can amount to a language policy issue if the organization expects language choice or user opt-in for locale constraints. There is no indication that this skill is explicitly region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This JSON file contains multiple natural-language test names and expected-result strings in Chinese, such as the entries at L07, L14, L21, L28, and L35. Because the file does not indicate that the skill is region-specific or provide an opt-in/choice of language, it may violate the policy against forcing a specific language or locale without user opt-in.

Content

No source excerpt is available for this finding.