Back to skill

Security audit

huawei-cloud-cc-central-network-query

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a read-only Huawei Cloud query helper, but its CLI installation guide tells users to execute unverified downloaded content as a shell script.

Install only if you are comfortable with a read-only Huawei Cloud inspection helper and can configure a least-privilege IAM policy. Do not follow the provided curl-and-bash CLI installation command as written; install hcloud from verified official Huawei Cloud instructions or a trusted package source, and verify signatures or checksums before running any installer.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
references/cli-installation-guide.md:7
Finding
Unverified Remote Content Is Downloaded and Executed as a Shell Script## Vulnerability Details **File Location**: `references/cli-installation-guide.md`, lines 7-13 **Vulnerability Type**: Unverified remote payload retrieval and execution **Risk Level**: High **Vulnerable code:** ```bash # Linux/macOS — download first, then execute curl -sSL -o /tmp/hcloud-install.sh https://support.huaweicloud.com/qs-hcli/hcli_02_003.html bash /tmp/hcloud-install.sh # Or download from: # https://support.huaweicloud.com/qs-hcli/hcli_02_003.html ``` ### Technical Analysis The installation instructions download content from a mutable external URL and immediately execute the resulting file with Bash. No cryptographic signature, expected checksum, version pin, content-type validation, or manual inspection is required before execution. The referenced URL has an `.html` suffix and is presented as a Huawei Cloud documentation page rather than a versioned shell-script artifact. Consequently, the command may download HTML rather than a valid installer. More importantly, any content ultimately returned after redirects is treated as trusted shell code. HTTPS protects the connection in transit when its trust assumptions hold, but it does not establish that the retrieved content is an immutable, reviewed installer. The effective payload can change after this skill package has been audited. Compromise of the remote publishing infrastructure, an authorized but malicious upstream modification, or an unsafe redirect could therefore turn these instructions into arbitrary code execution. Use of the predictable shared path `/tmp/hcloud-install.sh` also creates an avoidable local file-handling weakness. Another local process may be able to interfere with the path between download and execution, depending on host permissions and timing. ### Attack Path 1. An attacker gains control over the content served by the external URL, its redirect destination, or the relevant upstream publishing infrastructure. 2. The attacker cause ...[truncated 1811 chars]
Remediation
## Remediation Suggestions 1. Replace the documentation-page URL with Huawei Cloud's official, versioned installer package or release artifact. 2. Pin an explicit CLI version instead of retrieving mutable latest content. 3. Publish and verify a SHA-256 or stronger digest obtained through a separately trusted channel. Prefer verification of a vendor-provided digital signature. 4. Do not execute a downloaded file until its signature, checksum, expected file type, and source have been validated. 5. Use strict download options such as `curl --fail --show-error --location` so HTTP errors are not silently written and passed to Bash. 6. Use a securely created temporary directory rather than a predictable shared filename, and remove it after installation. 7. Avoid piping or immediately passing remote content to a shell. Provide a review step or use a trusted operating-system package manager where supported. 8. Run installation with the minimum necessary user privileges and explicitly warn users not to execute it from a privileged shell unless required and independently verified. 9. A hardened pattern should resemble: ```bash tmp_dir="$(mktemp -d)" trap 'rm -rf "$tmp_dir"' EXIT curl --fail --show-error --location \ --output "$tmp_dir/hcloud-installer" \ "https://official.example/versioned/hcloud-installer-VERSION" printf '%s %s\n' "PINNED_SHA256" "$tmp_dir/hcloud-installer" | sha256sum --check - # Execute only after signature or checksum verification. bash "$tmp_dir/hcloud-installer" ``` The placeholder URL and digest must be replaced with verified values from official Huawei Cloud release documentation.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The code is broadly aligned with a read-only CC Central Network inspection purpose and uses only hcloud query/list/show commands, so there is no undeclared destructive capability. However, the declared description claims coverage of single and list operations for attachments and connections, plus ER route table and GDGW attachment types. The supplied code only demonstrates four basic operations: list central networks, show one central network, list attachments, and list connections. It does not show querying a single attachment or single connection, nor any subtype-specific attachment inspection. Therefore the description overstates the implemented behavior, making this a description-behavior mismatch.

Excessive Permissions

Low
Category
Privilege Escalation
Content
## Prerequisites

1. **hcloud CLI** installed and authenticated. See `references/cli-installation-guide.md`.
2. **IAM permissions:** `cc:centralNetworks:list` and `cc:centralNetworks:get`. See `references/iam-policies.md`.
3. **Region:** Central Network is a global service — use any region where CC is available (e.g., `cn-north-4`).
4. **Domain ID:** Most commands require `--domain_id` (account ID). Obtain from IAM → My Credentials.
Confidence
80% confidence
Finding
Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Excessive Permissions

Low
Category
Privilege Escalation
Content
## Prerequisites

1. **hcloud CLI** installed and authenticated. See `references/cli-installation-guide.md`.
2. **IAM permissions:** `cc:centralNetworks:list` and `cc:centralNetworks:get`. See `references/iam-policies.md`.
3. **Region:** Central Network is a global service — use any region where CC is available (e.g., `cn-north-4`).
4. **Domain ID:** Most commands require `--domain_id` (account ID). Obtain from IAM → My Credentials.
Confidence
60% confidence
Finding
Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Static analysis

No suspicious patterns detected.