T08 · Insecure Dependencies
- Location
references/cli-installation.md:29- Finding
Unverified Mutable CLI Downloads Allow Supply-Chain Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
references/cli-installation.md, lines 29-41 and 49-89
Vulnerability Type: Unverified third-party installer and binary downloads from a mutablelatestpath
Risk Level: MediumVulnerable Code
Lines 29-41:
bash BASE=https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest curl -sSL "$BASE/hcloud_install.sh" -o ./hcloud_install.sh # Review the script source and contents before execution: less ./hcloud_install.sh bash ./hcloud_install.shThe non-interactive variant is:
bash BASE=https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest curl -sSL "$BASE/hcloud_install.sh" -o ./hcloud_install.sh # Review the script source and contents before execution: less ./hcloud_install.sh bash ./hcloud_install.sh -yLines 49-89 contain equivalent unverified binary downloads for supported platforms:
bash curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-linux-amd64.tar.gz" tar -zxvf huaweicloud-cli-linux-amd64.tar.gz sudo mv hcloud /usr/local/bin/ hcloud versionbash curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-linux-arm64.tar.gz" tar -zxvf huaweicloud-cli-linux-arm64.tar.gz sudo mv hcloud /usr/local/bin/ hcloud versionbash curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-mac-amd64.tar.gz" tar -zxvf huaweicloud-cli-mac-amd64.tar.gz sudo mv hcloud /usr/local/bin/ hcloud versionbash curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-mac-arm64.tar.gz" tar -zxvf huaweicloud-cli-mac-arm64.tar.gz sudo mv hcloud /usr/local/bin/ hcloud versionpowershell $url = "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-c ...[truncated 3086 chars]- Remediation
View remediation
Remediation Suggestions
- Replace mutable
latestURLs with an explicitly supported and immutable version. - Publish SHA-256 or stronger checksums through a separately authenticated release channel and require users to verify them before extraction or execution.
- Prefer vendor-signed packages or binaries and document mandatory publisher-signature verification.
- For installer scripts, download the script and detached signature, verify the signature against a pinned vendor key, and only then execute it.
- Remove or strongly discourage the unattended
bash ./hcloud_install.sh -yworkflow unless integrity verification has already succeeded. - Verify archives before extraction and verify the extracted executable before placing it in
/usr/local/binor a systemPATH. - Use a user-local installation directory where possible, avoiding elevated installation privileges.
- Document the expected version and verified digest so users can compare
hcloud versionand the artifact hash against known-good values. - Retain the existing restriction that the Agent must not download or install the dependency on the user's behalf.
- Replace mutable
