Back to skill

Security audit

huawei-cloud-cce-env-assessment

Security checks for vulnerabilities and agentic risk

Overview

The skill performs a plausible Huawei Cloud CCE assessment, but it asks for powerful cloud credentials and includes unsafe setup and API practices that require careful review.

Use only in an isolated workspace with temporary least-privilege read-only Huawei Cloud credentials. Avoid the non-interactive remote installer and any sudo or rm commands unless you independently verify them. Treat generated reports and data files as sensitive cluster inventory, and require TLS verification to be fixed before using this against production environments.

Vulnerability Patterns
  • 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
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/collect_all.py:168
Finding

TLS Certificate Verification Disabled for Authenticated Kubernetes API Requests

Content
View full analysis

Vulnerability Details

File Location: scripts/collect_all.py, lines 168–179
Vulnerability Type: Improper Certificate Validation
Risk Level: Medium

Complete Code Snippet

python
url = f"https://{host}{uri}"
t, auth = _sign_aksk("GET", uri, host, HWC_AK, HWC_SK)

cmd = [
    "curl", "-s", "-k",
    "-H", f"X-Access-Key: {HWC_AK}",
    "-H", f"X-Sdk-Date: {t}",
    "-H", f"Authorization: {auth}",
    "-H", f"Host: {host}",
    url
]
r = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=30)

Technical Analysis

The k8s_api() request includes curl's -k option, which disables TLS certificate and hostname verification. The request nevertheless carries the Huawei Cloud access-key identifier and a signed Authorization header.

This path is reached during normal collection when Huawei Cloud AK/SK credentials are configured. It is used to retrieve Kubernetes resources, including nodes, pods, deployments, services, security contexts, RBAC-related information, and ingress configuration.

Because server identity is not verified, an attacker capable of intercepting or redirecting the connection can impersonate the intended API endpoint. The request signature may prevent arbitrary modification of a request, but it does not restore server authentication or protect the response from forgery.

Attack Path

  1. The user configures Huawei Cloud AK/SK credentials and invokes the collection workflow.
  2. collect_all.py constructs an HTTPS URL for the cluster API endpoint.
  3. The script signs the GET request and invokes curl -k.
  4. A network-positioned attacker redirects or intercepts the connection and presents an arbitrary certificate.
  5. Certificate verification succeeds unconditionally because of -k.
  6. The attacker receives the authenticated request headers and can return forged Kubernetes API responses.
  7. The forged data is consumed by the collector and written into assessment art ...[truncated 958 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the insecure -k option and require normal CA-chain and hostname validation:
python
cmd = [
    "curl", "-sS", "--fail",
    "-H", f"X-Access-Key: {HWC_AK}",
    "-H", f"X-Sdk-Date: {t}",
    "-H", f"Authorization: {auth}",
    "-H", f"Host: {host}",
    url
]
  1. If the endpoint requires a private certificate authority, accept an explicitly configured CA bundle and pass it through --cacert. Do not disable verification globally.

  2. Fail closed when certificate validation fails. Do not silently retry with insecure TLS settings.

  3. Avoid placing authentication headers in child-process command-line arguments where practical. Use an HTTP client library with TLS verification enabled and headers supplied through its API, or provide curl headers through a securely permissioned temporary configuration or input channel.

  4. Add tests confirming that:

    • Untrusted certificates are rejected.
    • Hostname mismatches are rejected.
    • Valid certificates from the configured trust store succeed.
    • No fallback path reintroduces -k or equivalent insecure behavior.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (98)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description frames the skill as an assessment/reporting helper, but the workflow collects sensitive cloud configuration, authenticates with user-supplied AK/SK, may inspect a source repository, and generates multiple local artifacts. That mismatch can cause users to authorize the skill under false assumptions, increasing risk of credential exposure, over-collection, and unintended system changes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description frames the skill as an assessment/reporting helper, but the workflow collects sensitive cloud configuration, authenticates with user-supplied AK/SK, may inspect a source repository, and generates multiple local artifacts. That mismatch can cause users to authorize the skill under false assumptions, increasing risk of credential exposure, over-collection, and unintended system changes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description frames the skill as an assessment/reporting helper, but the workflow collects sensitive cloud configuration, authenticates with user-supplied AK/SK, may inspect a source repository, and generates multiple local artifacts. That mismatch can cause users to authorize the skill under false assumptions, increasing risk of credential exposure, over-collection, and unintended system changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs the agent to use sudo whenever permission problems occur, even though the skill is primarily an assessment workflow. This creates a path to unnecessary privilege escalation on the host, allowing local package changes, file deletion, or script execution with elevated rights if the workflow or dependencies are compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill asks the user to provide Huawei Cloud AK/SK and environment details, but the description does not clearly warn that it will handle sensitive credentials and collect potentially sensitive infrastructure configuration. This reduces informed consent and increases the chance of secrets being exposed to logs, artifacts, or unintended processing paths.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 140)May include surrounding context.

md
For every metric listed in `references/cloud-native-checklist.xlsx`, collect the corresponding environment information.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

md
For every metric listed in `references/cloud-native-checklist.xlsx`, collect the corresponding environment information.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 228)May include surrounding context.

md
For every metric listed in `references/cloud-native-checklist.xlsx`, collect the corresponding environment information.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

md
ctual metric items in `references/cloud-native-checklist.xlsx` and MUST invoke `scripts/collect_all.py` to collect fresh data — do NOT reuse historical or cache

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 233)May include surrounding context.

md
ctual metric items in `references/cloud-native-checklist.xlsx` and MUST invoke `scripts/collect_all.py` to collect fresh data — do NOT reuse historical or cache

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill includes a step to create a Kubernetes cluster certificate/kubeconfig, which can grant direct access to the cluster control plane. For an assessment skill, generating access material materially increases the blast radius if secrets are logged, stored insecurely, or misused by scripts.

Content

Scanner excerpt · SKILL.md (reported line 186)May include surrounding context.

hcloud cce ListClusters --cli-region=cn-north-4

text

### Get cluster kubeconfig certificate
```bash
hcloud cce CreateKubernetesClusterCert \
  --cli-region=cn-north-4 \

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is an installation and management guide for a broad cloud CLI, while the skill is described as a Huawei Cloud CCE environment assessment tool. This mismatch increases the chance the agent will be induced to perform unrelated setup, management, or destructive actions outside a read-oriented assessment scope, expanding the attack surface and user confusion.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The documentation instructs users to fetch and execute a remote shell script in one step. This is dangerous because any compromise of the hosting endpoint, release process, or network path can lead to arbitrary code execution on the target system, and in this skill context that execution may be mistaken as normal setup behavior.

Content

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

One-click Installation

bash
# Download and run official installation script (interactive)
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh

# Non-interactive installation (skip confirmation)
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

This repeats the remote-script execution pattern and adds -y, making the install non-interactive. That combination increases the likelihood of unattended arbitrary code execution and reduces opportunities for a human to detect unexpected behavior.

Content

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

curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh

Non-interactive installation (skip confirmation)

curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y

text

### Verify Installation

External Script Fetching

High
Category
Supply Chain
Confidence
97% confidence
Finding

The Dockerfile example builds an image by downloading and executing a remote script during docker build. This embeds supply-chain risk into automated builds and can make compromises reproducible across CI/CD pipelines and downstream environments.

Content

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

Custom Image

dockerfile
FROM ubuntu:latest
RUN apt-get update -y && apt-get install curl -y
RUN curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y
WORKDIR /workspace
ENTRYPOINT ["/usr/local/bin/hcloud"]

External Script Fetching

High
Category
Supply Chain
Confidence
96% confidence
Finding

This troubleshooting example still recommends downloading and executing a remote script, only changing the install directory. The same arbitrary code execution and supply-chain risks apply, and troubleshooting sections are especially likely to be copied verbatim by users under pressure.

Content

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

sudo bash ./hcloud_install.sh

Or install to user directory

curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -d ~/.local/bin

text

#### Command Not Found

External Script Fetching

High
Category
Supply Chain
Confidence
96% confidence
Finding

The update section advises reinstalling via a fetched remote script, reintroducing arbitrary code execution risk during maintenance. Because updates are performed repeatedly, this increases long-term exposure to supply-chain compromise.

Content

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

hcloud update

Or reinstall latest version

curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y

text

### Uninstall KooCLI

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

sudo rm -f /usr/local/bin/hcloud is a destructive command that removes an installed binary, and in an assessment skill context it is unrelated to the stated purpose. While it is a legitimate uninstall step, embedding such commands in broadly consumed skill documentation can lead to unintended deletion if copied without care.

Content

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

Uninstall KooCLI

bash
# Linux/macOS manual uninstallation:
sudo rm -f /usr/local/bin/hcloud
sudo rm -rf /usr/local/hcloud/
rm -rf ~/.hcloud/

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

sudo rm -rf /usr/local/hcloud/ recursively deletes an installation directory with elevated privileges. If executed on the wrong system or with an incorrect path, it can cause loss of installed tooling and potentially adjacent files, and its presence is unnecessary in a read-only assessment skill.

Content

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

bash
# Linux/macOS manual uninstallation:
sudo rm -f /usr/local/bin/hcloud
sudo rm -rf /usr/local/hcloud/
rm -rf ~/.hcloud/

# Windows manual uninstallation:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

sudo rm -rf /usr/local/hcloud/ recursively deletes an installation directory with elevated privileges. If executed on the wrong system or with an incorrect path, it can cause loss of installed tooling and potentially adjacent files, and its presence is unnecessary in a read-only assessment skill.

Content

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

bash
# Linux/macOS manual uninstallation:
sudo rm -f /usr/local/bin/hcloud
sudo rm -rf /usr/local/hcloud/
rm -rf ~/.hcloud/

# Windows manual uninstallation:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

rm -rf ~/.hcloud/ deletes the user’s CLI configuration and likely cached authentication or profile data. In this context, that can destroy local environment state and credentials/config needed for operations, and it is unrelated to performing an assessment.

Content

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

md
# Linux/macOS manual uninstallation:
sudo rm -f /usr/local/bin/hcloud
sudo rm -rf /usr/local/hcloud/
rm -rf ~/.hcloud/

# Windows manual uninstallation:
# 1. Delete hcloud.exe file

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

rm -rf ~/.hcloud/ deletes the user’s CLI configuration and likely cached authentication or profile data. In this context, that can destroy local environment state and credentials/config needed for operations, and it is unrelated to performing an assessment.

Content

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

md
# Linux/macOS manual uninstallation:
sudo rm -f /usr/local/bin/hcloud
sudo rm -rf /usr/local/hcloud/
rm -rf ~/.hcloud/

# Windows manual uninstallation:
# 1. Delete hcloud.exe file

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

rm -rf ~/.hcloud/cache/ is a targeted destructive command that removes cached CLI data. Although lower impact than deleting the full config directory, it can still affect troubleshooting, stored session artifacts, and reproducibility, and it is unnecessary in an assessment-focused skill.

Content

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

Clean Cache

bash
# Clean KooCLI cache
rm -rf ~/.hcloud/cache/

# Clean downloaded files
rm -f hcloud_install.sh huaweicloud-cli-*.tar.gz huaweicloud-cli-*.zip

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

rm -rf ~/.hcloud/cache/ is a targeted destructive command that removes cached CLI data. Although lower impact than deleting the full config directory, it can still affect troubleshooting, stored session artifacts, and reproducibility, and it is unnecessary in an assessment-focused skill.

Content

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

Clean Cache

bash
# Clean KooCLI cache
rm -rf ~/.hcloud/cache/

# Clean downloaded files
rm -f hcloud_install.sh huaweicloud-cli-*.tar.gz huaweicloud-cli-*.zip

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/collect_all.py (reported line 3)May include surrounding context.

python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Cloud-native assessment - full information collection (uses hcloud commands; no kubectl/kubeconfig dependency)."""
import os, sys, json, subprocess, base64, tempfile
from datetime import datetime
from pathlib import Path

Static analysis

Detected: suspicious.destructive_delete_command

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
references/koocli-installation-guide.md:212