T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:47
- Finding
- Unverified Remote Installer Is Piped Directly into Bash<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:47-49`; duplicated in `references/cli-installation-guide.md:21-24` **Vulnerability Type**: Remote payload retrieval and immediate shell execution **Risk Level**: High ### Vulnerable Code `SKILL.md:47-49`: ```bash curl -fsSL --connect-timeout 10 --max-time 120 https://aliyuncli.alicdn.com/setup.sh | bash aliyun version ``` `references/cli-installation-guide.md:21-24`: ```bash curl -fsSL --connect-timeout 10 --max-time 120 https://aliyuncli.alicdn.com/setup.sh | bash exec $SHELL -l aliyun version ``` ### Technical Analysis The installation instructions stream the current response from an external URL directly into Bash. The payload is not pinned to a reviewed version, downloaded for inspection, checked against a SHA-256 digest, or authenticated with a publisher signature. HTTPS protects the connection against ordinary interception when certificate validation and the trust store remain sound, but it does not protect against compromise of the CDN, origin server, DNS or certificate ecosystem, publisher account, or release process. It also does not prevent the content at the URL from changing after this Skill has been audited. Because Bash begins interpreting the response immediately, a malicious or compromised installer can execute arbitrary commands with the privileges of the user running the installation. The installation guide also recommends using `sudo` following a permission error at `references/cli-installation-guide.md:61`, which could cause a user to rerun the same unverified installer with administrative privileges. ### Attack Path 1. An attacker compromises the installer origin, CDN distribution, publisher account, or another part of the delivery chain. 2. The attacker replaces or modifies `setup.sh` with commands that install malware, steal credentials, alter shell configuration, or establish persistence. 3. A user or agent follows the Skill's installation instructions. 4. `curl` ...[truncated 954 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | bash` installation instructions. 2. Pin the Alibaba Cloud CLI to a specific reviewed version. 3. Download the artifact to a newly created private temporary directory rather than streaming it into a shell. 4. Obtain the expected digest or signature through an independently authenticated release channel. 5. Verify a publisher signature where available. At minimum, compare a pinned SHA-256 digest before execution. 6. Abort installation on any verification failure. 7. Display or inspect the downloaded installer before running it. 8. Execute installation without elevated privileges whenever possible. 9. Do not recommend `sudo` as a generic response to installer permission failures. Provide a documented user-local installation procedure instead. 10. Apply the corrected procedure consistently in both `SKILL.md` and `references/cli-installation-guide.md`. A safer pattern is: ```bash tmp_dir="$(mktemp -d)" chmod 700 "$tmp_dir" curl -fL --proto '=https' --tlsv1.2 \ -o "$tmp_dir/setup.sh" \ 'https://trusted.example/versioned/setup.sh' printf '%s %s\n' 'PINNED_SHA256' "$tmp_dir/setup.sh" | sha256sum -c - bash "$tmp_dir/setup.sh" rm -rf "$tmp_dir" ``` The URL, version, and digest must come from a trusted and reviewed release rather than using placeholders in production instructions. ]]>
