T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/cli-installation-guide.md:8
- Finding
- Unverified Mutable Remote Installer Is Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `references/cli-installation-guide.md:8-10` **Vulnerability Type**: Remote execution of an unpinned network payload **Risk Level**: High ### Vulnerable Code ```bash # One-line install (Linux/macOS) curl -sSL https://hwcloudcli.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 a shell script from a mutable `latest` URL and executes it without verifying a cryptographic signature, checksum, immutable version, or expected file contents. Although the URL appears to be an official Huawei Cloud endpoint and HTTPS protects transport in normal conditions, it does not protect users if the hosted object, storage account, DNS path, certificate authority, or upstream release process is compromised. The payload executed by users can also change after the Skill has been audited. This behavior is directly related to installing the declared CLI dependency, but the integrity controls are insufficient for safely executing remotely retrieved code. ### Attack Path 1. An attacker compromises the remote object, release pipeline, hosting account, or another component controlling the `latest` installer. 2. The attacker replaces the installer with a modified shell script. 3. A user follows the Skill's installation guide and downloads the current payload. 4. The user executes `bash hcloud_install.sh` without checking its identity or integrity. 5. The modified script runs arbitrary commands with the privileges of that user. ### Impact Assessment Successful exploitation permits arbitrary local command execution under the account running the installer. Depending on that account's privileges and local configuration, an attacker could: - Read Huawei Cloud credentials or KooCLI profiles accessible to the user. - Modify local files or developer tooling. - Steal database request files and infrastructure metadata. - ...[truncated 351 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin KooCLI to a specific reviewed version instead of using a mutable `latest` URL. 2. Publish and verify a SHA-256 or stronger checksum obtained through an independently authenticated channel. 3. Prefer a vendor-signed package and verify its signature against a pinned vendor key. 4. Fail closed if verification fails; never continue to execution. 5. Document the expected installer version and checksum in the Skill. 6. Review the downloaded script before execution and avoid elevated privileges unless explicitly required. For example: ```bash HCLOUD_VERSION="7.2.12" EXPECTED_SHA256="<vendor-published-sha256>" curl --fail --show-error --location \ "https://trusted.example/hcloud/${HCLOUD_VERSION}/hcloud_install.sh" \ --output hcloud_install.sh printf '%s %s\n' "${EXPECTED_SHA256}" hcloud_install.sh | sha256sum --check - bash hcloud_install.sh ``` ]]>
