T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/cli-installation-guide.md:11
- Finding
- Unverified Remote Installation Script Is Piped Directly into Bash<![CDATA[ ## Vulnerability Details **File Location**: `references/cli-installation-guide.md:11-12` **Vulnerability Type**: Remote payload retrieval followed by immediate shell execution **Risk Level**: High ### Vulnerable Code ```bash # Linux / macOS / Windows (curl install script) curl -sSL https://cn-north-4-hcli-cloud.s3.cn-north-4.myhuaweicloud.com/install.sh | bash ``` ### Technical Analysis The installation instructions stream a remotely hosted script directly into `bash`. The script is not pinned to a specific immutable version and is not validated using a cryptographic signature or trusted checksum before execution. Although the URL is hosted under a Huawei Cloud domain, the effective code executed by this command can change after the Skill package has been reviewed. Compromise or unauthorized modification of the remote object, its hosting account, or the network delivery path would turn this command into an arbitrary-code execution mechanism. Piping directly to a shell also prevents the user from inspecting the complete artifact before it runs. The `-s` option suppresses normal progress and some diagnostic output, reducing visibility during installation. Installing KooCLI may be necessary for the declared functionality, but fetching mutable content and immediately executing it is not the minimum-risk installation method. ### Attack Path 1. An attacker compromises the storage bucket, publishing credentials, artifact pipeline, or another mechanism controlling `install.sh`. 2. The attacker replaces the legitimate installer with a malicious shell script. 3. A user or Agent follows the Skill's documented prerequisite and executes the `curl | bash` command. 4. Bash executes the attacker-controlled payload with the privileges of the invoking user. 5. The payload can read accessible credentials, alter local files, install persistence, or execute additional programs. ### Impact Assessment Successful exploitation provides arbitrary command execution wi ...[truncated 428 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | bash` instruction. 2. Link to the official installation documentation and prefer a signed package manager or vendor-provided package. 3. If direct download is required: - Pin an exact KooCLI release. - Download the artifact to a local file without executing it. - Obtain the expected SHA-256 digest through a separately authenticated channel. - Verify the digest and, where available, the publisher's digital signature. - Inspect the downloaded content or package metadata. - Execute it only after successful verification. 4. Use a documented sequence such as: ```bash curl --fail --show-error --location \ --output install.sh \ "https://trusted.example/path/to/versioned/install.sh" printf '%s %s\n' '<PINNED_SHA256>' 'install.sh' | sha256sum --check - less install.sh bash install.sh ``` 5. Do not present one command as applying uniformly to Linux, macOS, and Windows unless the vendor explicitly supports and verifies that flow for all three platforms. ]]>
